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

32 lines
1.5 KiB
PHP

<?
if( isset($s[1]) && $s[1] == '3/fontan_win' ) {
//Âñå ïåðåìåííûå ñîõðàíÿòü â ìàññèâå $vad !
$vad = array(
'go' => false
);
//Ïðîâåðÿåì êàìíè
$vad['sp'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE (`item_id` = "881" OR `item_id` = "878") AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
if( isset($vad['sp']['id']) ) {
// Óäàëåíà ïðîâåðêà íà ãðóïïèðîâêó ïðåäìåòîâ 13.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 ) {
$vad['items'] = array(2413,2414,2415,2416);
$vad['items'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($vad['items'][rand(0,count($vad['items'])-1)]).'" LIMIT 1'));
$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$vad['sp']['id'].'" LIMIT 1');
if($upd){
$r = 'Âû ðàñòâîðèëè &quot;'.$vad['pl']['name'].'&quot;<br>';
$r = 'Îáûñêàâ &quot;'.$obj['name'].'&quot; âû îáíàðóæèëè &quot;'.$vad['items']['name'].'&quot;';
$this->pickitem($obj,$vad['items']['id'],$u->info['id'],'',$vad['dn_delete'][$vad['items']['id']]);
//echo '<script>location.href="main.php"</script>';
} else {
$r = '×òî-òî ïîøëî íå òàê, ïîïðîáóéòå ïîçæå.';
}
}elseif( !isset($vad['sp']['id']) ) {
$r = 'Òðåáóåòñÿ îäèí èç äðàãîöåííûõ êàìíåé';
}
unset($vad);
}
?>