32 lines
2.0 KiB
PHP
32 lines
2.0 KiB
PHP
<?
|
|
if(!defined('GAME')) {
|
|
die();
|
|
}
|
|
//âûáèðàåì ýôôåêò æåðòâû $usr
|
|
$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = "308" AND `uid` = "'.$usr['id'].'" AND `delete` = "0" LIMIT 1'));
|
|
//ýôôåêò ñâîé
|
|
$eff_users = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = "308" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" LIMIT 1'));
|
|
//ýôôåêò çàùèòû îò âîðà
|
|
$no_vor = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = "459" AND `uid` = "'.$usr['id'].'" AND `delete` = "0" LIMIT 1'));
|
|
if($u->info['login']==$usr['login']) {
|
|
$u->error = 'Ãëóïåö, òû íå ìîæåøü óêðàñòü ñàì ó ñåáÿ ;)';
|
|
}elseif(isset($no_vor['id'])) {
|
|
$u->error = 'Ïåðñîíàæ '.$usr['login'].' íå äðåìëåò, áóäüòå îñòîðîæíû';
|
|
}elseif($usr['battle'] > 0 ) {
|
|
$u->error = 'Ïåðñîíàæ '.$usr['login'].' â ïîåäèíêå!';
|
|
}elseif(!isset($eff['id'])) {
|
|
$u->error = 'Íà ïåðñîíàæå '.$usr['login'].' íåòó ýôôåêòà "Íåêòàð Çìåè"';
|
|
}elseif($eff_users['name'] && $eff_users['delete'] ==0) {
|
|
$u->error = 'Ó âàñ åñòü Íåêòàð Çìåè!';
|
|
}else{
|
|
//âîðóåì ýôôåêò
|
|
mysql_query('UPDATE `eff_users` SET `uid` = "'.$u->info['id'].'" WHERE `uid` = "'.$usr['id'].'" AND `name` = "'.$eff['name'].'" LIMIT 1');
|
|
$u->error = 'Âû óêðàëè ýôôåêò '.$eff['name'].' ó ïåðñîíàæà '.$usr['login'].'!';
|
|
//îòïðàâëÿåì ñèñòåìêó
|
|
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','".$usr['login']."',' Ïåðñîíàæ <b>".$u->info['login']." </b>óêðàë ó âàñ ýôôåêò ".$eff['name']." .','-1','6','0')");
|
|
$txt = '<font color=red>Âíèìàíèå!</font> <b>'.$u->info['login'].'</b> óêðàë ýôôåêò <b>'.$eff['name'].'</b> ó ïåðñîíàæà <b>'.$usr['login'].'</b>';
|
|
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$txt."','".time()."','6','0','1')");
|
|
//óìåíüøàåì èçíîñ
|
|
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
|
|
}
|
|
?>
|