
<b>
<?
            $update_game = mysql_query("UPDATE users SET gametime=\"$t\" WHERE NICK=\"$_SESSION[s]\"");
//тут скилл регенерация,в бою не должно работать!
if($query3[SKILL_REGENERATION]==1){$regT=5;}
if($query3[SKILL_REGENERATION]==2){$regT=10;}
if($query3[SKILL_REGENERATION]==3){$regT=15;}
if($query3[SKILL_REGENERATION]==4){$regT=20;}
if($query3[SKILL_REGENERATION]==5){$regT=25;}
if($query3[SKILL_REGENERATION]==6){$regT=30;}
if($query3[SKILL_REGENERATION]==7){$regT=35;}
if($query3[SKILL_REGENERATION]==8){$regT=40;}
if($query3[SKILL_REGENERATION]==9){$regT=45;}
if($query3[SKILL_REGENERATION]==10){$regT=50;}

$regHP=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");


while($regHP2=mysql_fetch_assoc($regHP)){
if($regHP2[loc]=='x999x001'){$hpi=mysql_query("UPDATE users SET MINhp=\"$regHP2[MAXhp]\",REGhp=\"$tgh2\" WHERE NICK=\"$_SESSION[s]\"");}
if($regHP2[loc]=='x999x002'){$hpi=mysql_query("UPDATE users SET MINhp=\"$regHP2[MAXhp]\",REGhp=\"$tgh2\" WHERE NICK=\"$_SESSION[s]\"");}
if($regHP2[loc]=='x999x003'){$hpi=mysql_query("UPDATE users SET MINhp=\"$regHP2[MAXhp]\",REGhp=\"$tgh2\" WHERE NICK=\"$_SESSION[s]\"");}
if($regHP2[loc]=='x999x004'){$hpi=mysql_query("UPDATE users SET MINhp=\"$regHP2[MAXhp]\",REGhp=\"$tgh2\" WHERE NICK=\"$_SESSION[s]\"");}
$rHP=(round($t-$regHP2[REGhp])/40);
$rHP2=$query3[MINhp]+10*$rHP;
$tgh=$t-$rHP/40;
$tgh2=$t+10;
if($t-$regHP2[REGhp]>=40 AND $query3[MINhp]+10*$rHP<$query3[MAXhp] AND $query3[statys]<1){
$hpi=mysql_query("UPDATE users SET MINhp=\"$rHP2\",REGhp=\"$tgh2\" WHERE NICK=\"$_SESSION[s]\"");
}
if($t-$regHP2[REGhp]>=40 AND $query3[MINhp]+10*$rHP>=$query3[MAXhp] AND $query3[statys]<1){
$hpi=mysql_query("UPDATE users SET MINhp=\"$query3[MAXhp]\",REGhp=\"$tgh2\" WHERE NICK=\"$_SESSION[s]\"");
}
}
?>
</b>
