" . Nick::id($user['id'])->full(1) . " и " . Nick::id($bot)->full(1) . "";
addlog($id, "Часы показывали " . date("Y.m.d H.i") . ", когда " . $rr . " бросили вызов друг другу.
");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']};");
if ($name2 != '') {
$sex2 = mysql_query("SELECT maxhp,id FROM users WHERE login='$name2'");
$dded2 = mysql_fetch_array($sex2);
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $d2 . "','" . $dded2["id"] . "','{$id}','" . $dded2["maxhp"] . "');");
$bot2 = mysql_insert_id();
$bd2 = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = '{$id}' LIMIT 1;"));
$battle2 = unserialize($bd2['teams']);
$battle2[$bot2] = $battle2[$bot];
foreach ($battle2[$bot2] as $k2 => $v2) {
$battle2[$k2][$bot2] = [0, 0, time()];
}
$t12 = explode(";", $bd2['t1']);
// проставляем кто-где
if (in_array($user['id'], $t12)) {
$ttt2 = 2;
} else {
$ttt2 = 1;
}
$sdds2 = mysql_query("UPDATE `battle` SET `teams` = '" . serialize($battle2) . "', `t" . $ttt2 . "`=CONCAT(`t" . $ttt2 . "`,';" . $bot2 . "') WHERE `id` = '{$id}'");
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = '{$id}' LIMIT 1;");
}
if ($name3 != '') {
$sex3 = mysql_query("SELECT maxhp,id FROM users WHERE login='$name3'");
$dded3 = mysql_fetch_array($sex3);
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $d3 . "','" . $dded3["id"] . "','{$id}','" . $dded3["maxhp"] . "');");
$bot3 = mysql_insert_id();
$bd3 = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = '{$id}' LIMIT 1;"));
$battle3 = unserialize($bd3['teams']);
$battle3[$bot3] = $battle3[$bot];
foreach ($battle3[$bot3] as $k3 => $v3) {
$battle3[$k3][$bot3] = [0, 0, time()];
}
$t13 = explode(";", $bd3['t1']);
// проставляем кто-где
if (in_array($user['id'], $t13)) {
$ttt3 = 2;
} else {
$ttt3 = 1;
}
$sdds3 = mysql_query("UPDATE `battle` SET `teams` = '" . serialize($battle3) . "', `t" . $ttt3 . "`=CONCAT(`t" . $ttt3 . "`,';" . $bot3 . "') WHERE `id` = '{$id}'");
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = '{$id}' LIMIT 1;");
}
//////////////////////////////////////////////////////
exit("");
//////////////////////////////////////////////////////
}