- Joined
- Nov 21, 2009
- Messages
- 165
- Reaction score
- 35
Това е скрипт за Мобио , който добавя директно зен в героя
<?PHP
$item = $_REQUEST["item"];
$fromnum = $_REQUEST["fromnum"];
$extid = $_REQUEST["extid"];
$mobio_remote_addr = "194.12.244.114";
$servID = "7362";
$db_serv = '127.0.0.1';
$db_user = 'sa';
$db_pass = ' ';
$db_name = 'MuOnline';
$zen_to_add = '350000000';
if($_SERVER['REMOTE_ADDR'] == $mobio_remote_addr) {
$sms_reply = 'Greshka.Spazvaite tochno instrukciite.';
$conn = mssql_connect($db_serv, $db_user, $db_pass);
if($conn) {
mssql_select_db($db_name);
$res = mssql_query("SELECT Money FROM Character WHERE Name='$item'");
if(mssql_num_rows($res)>0) {
mssql_query("UPDATE Character SET Money=Money+'$zen_to_add' WHERE Name='$item'");
}else{
mssql_query("INSERT INTO Character (Name, Money) VALUES('$item', '$zen_to_add')");
}
$res = mssql_query("SELECT Money FROM Character WHERE Name='$item'");
if(mssql_num_rows($res)>0) {
$row = mssql_fetch_row($res);
$sms_reply = "MuPlayring-Vashiqt zen e uspeshno zakupen. Imate {$row[0]} zen.";
}
}
file("http://mobio.bg/paynotify/pnsendsms.php?servID=$servID&tonum=$fromnum&extid=$extid&message=".urlencode($sms_reply));
}
?>