30 lines
1.2 KiB
PHP
30 lines
1.2 KiB
PHP
<?
|
|
/*
|
|
Бабушка покормила
|
|
|
|
*/
|
|
$timetest=time()-24*60*60;
|
|
$check = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars`= "day_korm" AND `time` > "'.$timetest.'"'));
|
|
|
|
if(!isset($check['id']))
|
|
{
|
|
mysql_query('UPDATE `users` SET `room`= 9 WHERE `id` = "'.$u->info['id'].'"');
|
|
mysql_query('UPDATE `stats` SET `hpNow`= 0 WHERE `id` = "'.$u->info['id'].'"');
|
|
|
|
$rtxt='Накормила, спать уложила, всю жизненную энергию выпила и на цп выбросила '.$u->info['login'].'!';
|
|
|
|
$cmsg = new ChatMessage();
|
|
$cmsg->setCity($u->info['city']);
|
|
$cmsg->setRoom($u->info['room']);
|
|
$cmsg->setText($rtxt);
|
|
$cmsg->setType(6);
|
|
$cmsg->setTypeTime(1);
|
|
(new Chat())->sendMsg($cmsg);
|
|
mysql_query('INSERT INTO `actions`(`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("'.$u->info['id'].'","'.time().'","capitalcity","421","day_korm"," ","","'.$u->info['exp'].'")');
|
|
}
|
|
else
|
|
{
|
|
$txt .= '<br><b><font color=red>Эх шустрый малец, тыж съел все сегодня! Завтра приходи накормлю чем нибудь вкусным!</b></font>';
|
|
}
|
|
|
|
?>
|