37 lines
1.4 KiB
PHP
37 lines
1.4 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
|
|
if( $itm['magic_inci'] == 'propuskpsh2' ) {
|
|
$test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "propuskpsh" AND `time` > "'.(time()-300).'" LIMIT 1'));
|
|
if( $u->info['align'] != 2 ) {
|
|
if( isset($test['id']) ) {
|
|
$u->error = 'Çàäåðæêà íå ïðîøëà, åùå '.$u->timeOut($test['time']-time()+300);
|
|
}else{
|
|
$u->addAction(time(),'propuskpsh2','');
|
|
$u->error = 'Âñå ïðîøëî óñïåøíî, çàäåðæêè â ïåùåðû ñíÿòà 24 ÷àñà.';
|
|
|
|
mysql_query('UPDATE `actions` SET `time` = `time` - 86400 WHERE `uid` = '.$u->info['id'].' AND `time` > "'.(time()-86400).'" AND `vars` LIKE "psh%" AND `vars` != "psh102" AND `vars` NOT LIKE "psh\_%"');
|
|
|
|
|
|
$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 476 AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
|
|
|
|
if(isset($eff['id']))
|
|
{
|
|
mysql_query('UPDATE `eff_users` SET `timeUse` = `timeUse` - 86400 WHERE `id` = '.$eff['id'].' ');
|
|
}
|
|
|
|
|
|
|
|
// Äåéñòâóåò òîëüêî íà:
|
|
// 1) ãäå òàéìåð ìåíüøå 12 ÷àñîâ. (÷òîáû î÷åíü ñòàðûå ïîõîäû íå ìåíÿëè âðåìÿ ïîõîäà 4 ñâèòêà, è ñóòêè íàçàä, èñòîðèÿ ïîõîäîâ íåêîððåêòíàÿ).
|
|
// 2) íå ñðàáîòàåò íà Ïåùåðó Äðàêîíîâ.
|
|
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = '.$itm['id'].' LIMIT 1');
|
|
}
|
|
}else{
|
|
$u->error = 'Õàîñíèêè íå ìîãóò ïîëüçîâàòüñÿ ïðîïóñêîì!';
|
|
}
|
|
}
|
|
?>
|