Файл: include/effect_3_fubhiiggji.php
Строк: 19
<?php
r
include '../system/common.php';
include '../system/functions.php';
include '../system/user.php';
if(!$user) {
header('location: /');
exit;
}
$title = 'Магазин эффектов';
include '../system/h.php';
?>
$q = mysql_query('SELECT * FROM `effects` WHERE `on` = "1" AND `sys_name` = "Эффект выживания" AND `last` < "'.time().'" ORDER BY `id` DESC');
while($post = mysql_fetch_assoc($q)) {
$i++;
echo $i;
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = $post[id_user] LIMIT 1"));
if($ank[online] < time()-300){
mysql_query('UPDATE `effects` SET `on` = 0 WHERE `id` = "'.$post['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `def` = "'.($ank['def']-200).'", `max_health` = "'.($ank['max_health']-200).'" WHERE `id` = "'.$ank[id].'" LIMIT 1');
}
}
?>