Файл: public_html/pve.php
Строк: 21
<?php
$title = 'Бой';
require_once ('system/function.php');
require_once ('system/header.php');
$time=time();
if ($user[pvp]==1 or $user[pve]==1){
header ('Location: loc.php?');
exit;
}
///////////////
$id=intval($_GET['id']);
////////////////////////
$req = mysql_query("SELECT * FROM `mutants` WHERE `id`='$id' and `x`='$user[x]' and `y`='$user[y]' LIMIT 1");
///////////////////////
if (mysql_num_rows($req)==0){
header ('Location: loc.php?');exit;
exit;}
///////////////////////
$mut = mysql_fetch_assoc($req);
if($mut['status']=='battle' or $mut['status']=='off'){
header ('Location: loc.php?');exit;
}
mysql_query("UPDATE `mutants` SET `status` = 'battle' WHERE `id`='$id' LIMIT 1");
mysql_query("UPDATE `users` SET `pve` = '1' WHERE `login`='$user[login]' LIMIT 1");
mysql_query("INSERT INTO `pvelog` SET `user` = '$user[login]',`mutant` = '$id',`log` = 'Бой начат!',`userpos` = '0',`mutantpos` = '250',`lastime`='$time'");
header ('Location: pvebattle.php?');exit;
require_once ('system/footer.php');
?>