Файл: bot.php
Строк: 47
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Антискрипт';
include($path.'files/core.php');
$bots=mysql_num_rows(mysql_query("SELECT * FROM `bot` WHERE `usr`='".$udata['id']."'"));
if($bots==0)
{
header('location: game.php');exit;
}
$bot=mysql_fetch_array(mysql_query("SELECT * FROM `bot` WHERE `usr`='".$udata['id']."'"));
if($bot['time']<=time())
{
if($bot['tim']>time())
{
$tr=time()+rand(300,420);
$trr=$tr+60;
mysql_query("UPDATE `bot` SET
`time`='".$tr."',
`tim`='".$trr."'
WHERE `usr`='".$udata['id']."'
");
}
else
{
$tr=time()+rand(300,420);
$trr=$tr+60;
mysql_query("UPDATE `bot` SET
`time`='".$tr."',
`tim`='".$trr."'
WHERE `usr`='".$udata['id']."'
");
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='2' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='2',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='2'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='2'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='2'"));
$usrz=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$udata['id']."'"));
$text='Блок за посивность! Персонаж: <img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png> '.$usrz['lvl'].'';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='2'
");
}
}
else
{
$tr=time()+rand(300,420);
$trr=$tr+60;
mysql_query("UPDATE `bot` SET
`time`='".$tr."',
`tim`='".$trr."'
WHERE `usr`='".$udata['id']."'
");
$rows21=mysql_num_rows(mysql_query("SELECT * FROM `msg_kont` WHERE `usr1`='2' and `usr2`='0'"));
if($rows21==0)
{
mysql_query("INSERT INTO `msg_kont` SET
`id`='',
`usr1`='2',
`usr2`='0',
`read`='1',
`time`='".time()."'
");
}else
{
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='2'"));
mysql_query("UPDATE `msg_kont` SET `read`='1', `time`='".time()."' WHERE `usr2`='0' and `usr1`='2'");
}
$rows2=mysql_fetch_array(mysql_query("SELECT * FROM `msg_kont`
WHERE `usr2`='0' and `usr1`='2'"));
$usrz=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$udata['id']."'"));
$text='Блок за посивность! Персонаж: <img src=img/main/c'.$usrz['klass'].'.png> <img src=img/main/r'.$usrz['rasa'].'.png>
<a href=info.php?id='.$usrz['id'].'>'.$usrz['usr'].'</a> <img src=img/main/p10.png> '.$usrz['lvl'].'';
mysql_query("INSERT INTO `msg_dialog` SET
`id`='',
`dialog`='".$rows2['id']."',
`vhod`='1',
`time`='".time()."',
`text`='".$text."',
`usr`='2'
");
}
header('location: '.$_SERVER['HTTP_REFERER'].'?kick');exit;
?>