= 1) {
if ($user['invis'] == 1) {
$user['login'] = 'невидимка';
}
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `battle` = $user[battle] AND `name` LIKE '" . $user['login'] . " (клон%'"));
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`, `owner`) VALUES ('" . $user['login'] . " (клон " . ($nb[0] + 1) . ")', '" . $user['id'] . "', '" . $user['battle'] . "', '" . $user['hp'] . "', '" . $user['id'] . "')");
$bot = mysql_insert_id();
$bd = mysql_fetch_array(mysql_query('SELECT `id`, `t1`, `t2`, `teams` FROM `battle` WHERE `id` = "' . $user['battle'] . '" LIMIT 1'));
$battle = unserialize($bd['teams']);
$battle[$bot] = $battle[$user['id']];
foreach ($battle[$bot] as $k => $v) {
$battle[$k][$bot] = [0, 0, time()];
}
$t1 = explode(";", $bd['t1']);
if (in_array($user['id'], $t1)) {
$ttt = 1;
} else {
$ttt = 2;
}
if ($user['invis'] == 1) {
$lo = 'невидимка';
} else {
$lo = Nick::id($user['id'])->short();
}
if ($user['invis'] == 1) {
$los = 'невидимка';
} else {
$los = Nick::id($bot)->short();
}
GameLogs::addBattleLog($user['battle'], '' . date("H:i") . ' ' . $lo . ' породил своего клона ' . $los . '.