Файл: public_html/pvebattle.php
Строк: 28
<?php
$title = 'Бой';
require_once ('system/function.php');
require_once ('system/header.php');
$req = mysql_query("SELECT * FROM `pvelog` WHERE `user` = '$user[login]'");
$batlog = mysql_fetch_array($req);
$req = mysql_query("SELECT * FROM `mutants` WHERE `id` = '$batlog[mutant]'");
$mut = mysql_fetch_array($req);
$time=time();
if($mut[hp]<=0){
mysql_query("DELETE FROM `pvelog` WHERE `user` = '$user[login]'");
$kills=$user[mutantkill]+1;
$exp=$user[exp]+$mut[exp];
mysql_query("UPDATE `users` SET `pve` = '0', `mutantkill` = '$kills', `exp` = '$exp' WHERE `login` = '$user[login]' LIMIT 1");
mysql_query("UPDATE `mutants` SET `status` = 'off', `timeresp` = '$time', `hp` = '$mut[maxhp]' WHERE `id` = '$mut[id]' LIMIT 1");
echo "<center><b>Победа!</b></center>
<font color='lime'><b>+</b></font>$mut[exp] опыта<br/><a href='/loc.php?'>Дальше</a>";
include('system/footer.php');
exit;
}
if($user[hp]<=0){
mysql_query("DELETE FROM `pvelog` WHERE `user` = '$user[login]'");
$dies=$user[dies]+1;
mysql_query("UPDATE `users` SET `pve` = '0', `dies` = '$dies', `x` = '0', `y` = '0', `hp` = '50', `energy` = '50' WHERE `login` = '$user[login]' LIMIT 1");
mysql_query("UPDATE `mutants` SET `status` = 'life' WHERE `id` = '$mut[id]' LIMIT 1");
echo "Поражение...<br/><a href='/loc.php?'>Дальше</a>";
include('system/footer.php');
exit;
}
echo "$mut[name], $mut[uron]";
require_once ('system/footer.php');
?>