- Joined
- Apr 29, 2010
- Messages
- 1,113
- Reaction score
- 180
IF WITH SMS...
SQL Query:
GM Remove function:
INFO:
credits: M3,Damian & Mobio(for credits script)
ChangeLOG:
MobioScript:
PHP:
<?PHP
function mssql_real_escape_string($str) { return str_replace("'","''",$str); }
$item = mssql_real_escape_string($_REQUEST["item"]);
$fromnum = mssql_real_escape_string($_REQUEST["fromnum"]);
$extid = mssql_real_escape_string($_REQUEST["extid"]);
$mobio_remote_addrs = array("87.120.176.216", "194.12.244.114");
$servID = 3503;
$db_serv = 'localhost'; //LET IT LIKE THAT :)
$db_user = 'sa'; //YOUR MSSQL USER
$db_pass = 'sqlpassword'; //YOUR MSSQL PASSWORD
$db_name = 'MuOnline'; //YOUR DATABASE NAME - USUALLY MuOnline(where character table is located)
$ctl = '32'; //YOUR CTLCODE (OLD VERS- 8 / NEW- 32)
$gmtime = '24'; //THE GM TIME(WICH IS BEFORE THE MAX LEVELS)
$max = '10'; //THE MAXIMUM GMLEVELS
if(in_array($_SERVER['REMOTE_ADDR'], $mobio_remote_addrs)) {
$sms_reply = 'Greshka. Spazvaite to4no instrukciite!';
$conn = mssql_connect($db_serv, $db_user, $db_pass);
if($conn) {
mssql_select_db($db_name);
$res = mssql_query("SELECT CtlCode FROM Character WHERE name='$item'");
$lvl = mssql_query("SELECT GMlevel FROM Character WHERE name='$item'");
if(mssql_num_rows($res)!=0 && mssql_num_rows($lvl)!=$max) {
mssql_query("UPDATE Character SET CtlCode='32',GMTime=' ".(time()+3600*$gmtime)."',GMlevel='1' where name='$item'"); }
elseif(mssql_num_rows($res)!=0 && mssql_num_rows($lvl)==$max) {}
$res = mssql_query("SELECT CtlCode FROM Character WHERE name='$item'");
$lvl = mssql_query("SELECT GMlevel FROM Character WHERE name='$item'");
if(mssql_num_rows($res)!=1) {
$sms_reply = "Vie uspeshno stanahte GameMaster!!! Shte ste GM za {$gmtime} chasa .";
}
elseif(mssql_num_rows($res)==$ctl && mssql_num_rows($lvl)==$max) {
$sms_reply = "Vie uspeshno stanahte GameMaster ZAVINAGI!!!";
}
}
file("http://mobio.bg/paynotify/pnsendsms.php?servID=$servID&tonum=$fromnum&extid=$extid&message=".urlencode($sms_reply));
}
?>
SQL Query:
Code:
alter table character add GMtime varchar(20) null, GMlevel varchar(20) null
GM Remove function:
AS PHP:
AS SQL Agent JOB TSQL Query - recommended:
PHP:
$max = '10'; //THE MAXIMUM GMLEVELS
mssql_query("update character set ctlcode='0' WHERE GMTime<='".time()."' and GMlevel=='".($max)."' and CtlCode>='2'");
AS SQL Agent JOB TSQL Query - recommended:
update character set ctlcode='0' WHERE GMTime<='".time()."' and GMlevel!='MAX GMLEVEL HERE' and CtlCode>='2'
SQL Query се execute в Query Analyzer-а, за да създаде колоната за времето.
GM Remove Function се слага или като SQL Job или в скрипта за GM-тата, както дамиан каза
GM Remove Function се слага или като SQL Job или в скрипта за GM-тата, както дамиан каза
Кода за премахването на гм-тата можеш да го сложиш в сайта където се показват всички гм-та.
credits: M3,Damian & Mobio(for credits script)
ChangeLOG:
// 04/05/2011 GM Add Mobio Script function - Modded! (now you just need to edit $gmtime to the hours you want they to be gm)
// 04/05/2011 GM Remove Query for SQL Agent Job & for PhP - Fixed!
// 30/04/2011 TSQL ако искате да ги премахва чрез SQL Agent Job - Added!
// 15/06/2011 GM Remove Query for SQL Agent Job & for PhP - Fixed!
// 29/06/2011 GMlevels(MOBIO,GMRemove functions and the sql query are the edited scripts) & CtlCode changable - ADDED! - HOT!!
// 29/06/2011 SOME MISTAKES - Corrected!
// 04/05/2011 GM Remove Query for SQL Agent Job & for PhP - Fixed!
// 30/04/2011 TSQL ако искате да ги премахва чрез SQL Agent Job - Added!
// 15/06/2011 GM Remove Query for SQL Agent Job & for PhP - Fixed!
// 29/06/2011 GMlevels(MOBIO,GMRemove functions and the sql query are the edited scripts) & CtlCode changable - ADDED! - HOT!!
// 29/06/2011 SOME MISTAKES - Corrected!
Last edited: