Размер файла: 856B
<?php
defined('PROTECTOR') or die('Error: restricted access');
$date = time();
$dueli = mysql_num_rows(mysql_query("SELECT * FROM userduel WHERE usr = '$log' LIMIT 1"));
if($dueli==0){
$be=mysql_fetch_array(mysql_query("SELECT * FROM regenerator WHERE usr = '$log' LIMIT 1"));
if($set[vip]==on){$k_point=intval((time()-$be['last'])/5);}else{
$k_point=intval((time()-$be['last'])/10);}
$k_point2=intval((time()-$be['last'])/10);
if($k_point>=1){
if($in_battle==0 and $inpk==0 and $inar==0){
$newhp=$udata['hp']+(2*$k_point);
$newmp=$udata['mp']+(2*$k_point2);
if($newhp>$udata['hpall']){$newhp=$udata['hpall'];}
if($newmp>$udata['mpall']){$newmp=$udata['mpall'];}
mysql_query("UPDATE users SET hp = '$newhp',mp='$newmp' WHERE usr = '$log' LIMIT 1");
mysql_query("UPDATE regenerator SET last = '$date' WHERE usr = '$log' LIMIT 1");}}
}
?>