game/_incl_data/class/dnaction/101/viboina2.php
2022-06-07 00:30:34 +03:00

35 lines
1.5 KiB
PHP

<?
if( isset($s[1]) && $s[1] == '101/viboina2' ) {
/*
Âûáîèíà
* Òåëåïîðòèðóåò íà íåîáõîäèìóþ êëåòêó õ 4 , ó 26
* Äëÿ ïðîõîäà òðåáóåòñÿ 1 Ëèíçà Ïîðòàëà - 4298
*/
//Âñå ïåðåìåííûå ñîõðàíÿòü â ìàññèâå $vad !
$vad = array(
'go' => false
);
//Ïðîâåðÿåì êàìíè
$vad['sp'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "4298" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
if( isset($vad['sp']['id']) ) {
// Óäàëåíà ïðîâåðêà íà ãðóïïèðîâêó ïðåäìåòîâ 14.10.2015
// $vad['pl'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$vad['sp']['item_id'].'" LIMIT 1')); // Áåðåì íàçâàíèå "Ëèíçà Ïîðòàëà" è âñå.. ñìûñë çàïðîñà... ñòàòèêà.
$vad['go'] = true;
}
if( $vad['go'] == true ) {
mysql_query('UPDATE `stats` SET `x` = "4",`y` = "26",`s` = "4" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//$u->deleteItem($vad['sp']['id'],$u->info['id'],1);// Óáðàíî 14.10.2015
$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$vad['sp']['id'].'" LIMIT 1');
if($upd){
$r = 'Âû ïåðåìåñòèëèñü ïðè ïîìîùè &quot;Ëèíçà Ïîðòàëà&quot; íà äðóãóþ ñòîðîíó';
echo '<script>location.href="main.php"</script>';
} else {
$r = '×òî-òî ïîøëî íå òàê, ïîïðîáóéòå ïîçæå.';
}
}elseif( !isset($vad['sp']['id']) ) {
$r = 'Äëÿ ïåðåìåùåíèÿ òðåáóåòñÿ &quot;Ëèíçà Ïîðòàëà&quot;';
}
unset($vad);
}
?>