0) { $zv = mysql_fetch_array( mysql_query( 'SELECT `id`,`time`,`razdel` FROM `zayvki` WHERE `id` = "' . $pl['zv'] . '" AND `btl_id` = 0 LIMIT 1' ) ); if (!isset($zv['id']) || $zv['razdel'] != 5) { $pl['zv'] = 0; mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } } if ($pl['battle'] == -1) { mysql_query('UPDATE `users` SET `battle` = 0,`ipreg` = 0 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); $pl['battle'] = 0; $pl['ipreg'] = 0; } if ((date('i') == 5 || date('i') == 6 || date('i') == 15 || date('i') == 16 || date('i') == 25 || date( 'i' ) == 26 || date('i') == 35 || date('i') == 36 || date('i') == 45) && $pl['zv'] == 0) { mysql_query('UPDATE `users` SET `ipreg` = 0 WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } if ((!isset($btltest2[$pl['battle']]) || $btltest2[$pl['battle']] == 0) && $pl['battle'] > 0) { $btltest2[$pl['battle']]++; echo '|' . $pl['battle'] . '|' . $pl['id'] . '|inBATTLE | '; inuser_go_btl($pl); echo '{!}'; } if ($pl['zv'] == 0 && ($pl['battle'] == 0 || !isset($btltest[$pl['battle']]) || $btltest[$pl['battle']] < 1)) { $btltest[$pl['battle']]++; if ($pl['timereg'] == 0) { mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } else { mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } if ($pl['exp'] > 400000 && $pl['level'] == 8) { $pl['exp'] = 400000; mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 3500000 && $pl['level'] == 9) { $pl['exp'] = 3500000; mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 48000000 && $pl['level'] == 10) { $pl['exp'] = 48000000; mysql_query('UPDATE `stats` SET `exp` = "48000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 148000000 && $pl['level'] == 11) { $pl['exp'] = 148000000; mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 400000000 && $pl['level'] == 12) { $pl['exp'] = 400000000; mysql_query('UPDATE `stats` SET `exp` = "400000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } if ($pl['bot'] == 0) { mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } mysql_query('UPDATE `stats` SET `nextAct` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); mysql_query( 'UPDATE `users` SET `online` = "' . time() . '",`afk` = "" WHERE `id` = "' . $pl['id'] . '" LIMIT 1' ); BotLogic::start($pl['id']); } else { if ($pl['timereg'] == 0) { mysql_query('UPDATE `users` SET `timereg` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } else { mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } if ($pl['exp'] > 400000 && $pl['level'] == 8) { $pl['exp'] = 400000; mysql_query('UPDATE `stats` SET `exp` = "400000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 3500000 && $pl['level'] == 9) { $pl['exp'] = 3500000; mysql_query('UPDATE `stats` SET `exp` = "3500000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 48000000 && $pl['level'] == 10) { $pl['exp'] = 48000000; mysql_query('UPDATE `stats` SET `exp` = "48000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 148000000 && $pl['level'] == 11) { $pl['exp'] = 148000000; mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } elseif ($pl['exp'] > 400000000 && $pl['level'] == 12) { $pl['exp'] = 400000000; mysql_query('UPDATE `stats` SET `exp` = "148000000" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } if ($pl['bot'] == 0) { mysql_query('UPDATE `stats` SET `bot` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } mysql_query('UPDATE `stats` SET `nextAct` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } } $ii++; echo 'TEST:' . $ii; unset($btltest, $btl_ref, $btltest2); sleep(4); }