// ----- # Отнимаем жизни # ----- /
mysql_query("UPDATE players, participants SET players.hp_now=if(players.hp_now<$damage[1],0,players.hp_now-$damage[1]), participants.hp=if(participants.hp<$damage[1],0,participants.hp-$damage[1]), participants.damage=participants.damage+".$damage['0']." WHERE players.id='".$stat['id']."' AND participants.time='".$stat['battle']."' AND participants.id='".$stat['id']."'");
mysql_query("UPDATE players, participants SET players.hp_now=if(players.hp_now<$damage[0],0,players.hp_now-$damage[0]), participants.hp=if(participants.hp<$damage[0],0,participants.hp-$damage[0]), participants.damage=participants.damage+".$damage['1']." WHERE players.id='".$opp_stat['id']."' AND participants.time='".$stat['battle']."' AND participants.id='".$opp_stat['id']."'");
/*
mysql_query("UPDATE players SET hp_now=if(hp_now<$damage[1],0,hp_now-$damage[1]) WHERE id='".$stat['id']."'");
mysql_query("UPDATE participants SET hp=if(hp<$damage[1],0,hp-$damage[1]), damage=damage+".$damage['0']." WHERE time='".$stat['battle']."' AND id='".$stat['id']."'");
mysql_query("UPDATE players SET hp_now=if(hp_now<$damage[0],0,hp_now-$damage[0]) WHERE id='".$opp_stat['id']."'");
mysql_query("UPDATE participants SET hp=if(hp<$damage[0],0,hp-$damage[0]), damage=damage+".$damage['1']." WHERE time='".$stat['battle']."' AND id='".$opp_stat['id']."'");
*/
$participant['damage'] += $damage['0'];
//echo mysql_error();
if($stat['hp_now'] > $damage['1']) $stat['hp_now']-=$damage['1'];
else $stat['hp_now']=0;
// HP для комментариев
if ($opp_stat['hp_now']<$damage[0]) $comhp_0=0; else $comhp_0=$opp_stat['hp_now']-$damage[0];
$comhp_1=$stat['hp_now'];
//