$us=mysql_fetch_array(mysql_query("SELECT *, (SELECT `id` FROM `online` WHERE `real_time` >= ".(time()-60)." AND `id` = `users`.`id`) AS `online` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
$owntravma=mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = ".$us['id']." AND (`type` = 13 OR `type` = 12 OR `type` = 14) LIMIT 1"));
$us_b=mysql_fetch_array(mysql_query("SELECT `type`, `open` FROM `battle` WHERE `id` = '{$us['battle']}' LIMIT 1"));
$vip=mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `attack` FROM `abils_vip` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$effect=mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = '{$us['id']}' AND `time` > '".time()."' AND `type` = '227' LIMIT 1"));
$jert=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['target'])."' LIMIT 1"));
if($jert['id']!=$user['id']){
addch("<img src=i/magic/attack.gif> <B>{$lo}</B>, применив магию нападения, внезапно ".$action." на "{$_POST['target']}"");
addchp('<font color=red>Внимание!</font> На вас '.$action.' <b>'.$lo.'</b>.<br />\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ','{[]}'.nick7($jert['id']).'{[]}');
if($jert['id']>_BOTSEPARATOR_){
$arha=mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `prototype` = '.$jert['id'].' LIMIT 1'));
$jert['battle']=$arha['battle'];
$jert['id']=$arha['id'];
$bot=1;
}
if($jert['battle']>0){
$bd=mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = '.$jert['battle'].' LIMIT 1'));
$battle=unserialize($bd['teams']);
$ak=array_keys($battle[$jert['id']]);
$battle[$user['id']]=$battle[$ak[0]];
foreach($battle[$user['id']]as$k=>$v){
$battle[$user['id']][$k]=array(0,0,time());
$battle[$k][$user['id']]=array(0,0,time());
}
$t1=explode(";",$bd['t1']);
if(in_array($jert['id'],$t1)){
$ttt=2;
}else{
$ttt=1;
}
addch("<b>".$los."</b> вмешался в <a href=logs.php?log=".$id." target=_blank>поединок »»</a>.",$user['room']);