Файл: KOSMOS/arena/battle.php
Строк: 71
<?php
$user=$ku;
$udata2 = $ku;
$arena_o = mysql_fetch_array(mysql_query("SELECT * FROM `arena` WHERE `oponent` = '$ku[nick]'"));
$arena_w = mysql_fetch_array(mysql_query("SELECT * FROM `arena` WHERE `lider` = '$ku[nick]'"));
if($arena_o['oponent'] == $user['nick']) header('Location: ?go_boy'); //// если есть уже в бою
if($arena_w['lider'] == $user['nick']) header('Location: ?go_boy'); //// если есть уже в бою
///// Author MyStyle
///// Skype asus_a52f
@$id=intval($_GET[id]);
if(empty($id))
{
echo 'Ошибка...';
include_once 'inc/foot.php';
}
$req = mysql_query("SELECT * FROM `arena` WHERE `id`='$id' and `status` = 'on'");
$avto = mysql_num_rows($req);
$arena = mysql_fetch_array($req);
if($arena['lider'] == $user['nick']) {
header('Location: ?go_boy&LinkNoUser'); //// перенаправляем хулиганов
exit;
}
if($avto <= 0)
{
echo 'Ошибка...';
include 'inc/foot.php';
exit;
}
if($user['arena2'] < $arena['min_lvl'])
{
echo'Ваш уровень слишком мал.';
include_once 'inc/foot.php';
}
if($ku['arena2'] > $arena['max_lvl'] && $ku['arena2'] == $arena['max_lvl'])
{
echo'Ваш уровень слишком велик.';
include_once 'inc/foot.php';
}
$req = mysql_query("SELECT * FROM `tmp_arena` WHERE `oponent`='".$udata2['nick']."'");
$avto = mysql_num_rows($req);
if($avto > 0)
{
echo 'Ошибка...';
include 'inc/foot.php';
exit;
}
$times = time() + 600;
mysql_query("INSERT INTO `arena_h` SET `user` = '".$udata2['nick']."', `who` = '".$arena['lider']."', `time` = '$time'");
mysql_query("UPDATE `arena` SET `oponent` = '".$udata2['nick']."', `status` = 'off', `timer` = '$times' WHERE `id` = '$id' LIMIT 1");
mysql_query("UPDATE `tmp_arena` SET `oponent` = '".$udata2['nick']."' WHERE `usr` = '".$arena['lider']."' LIMIT 1");
mysql_query("INSERT INTO `tmp_arena` SET `usr` = '".$udata2['nick']."', `id_user` = '".$udata2['id']."', `oponent` = '".$arena['lider']."', `step` = 'not'");
header('Location: ?go_boy');
?>