} else { setLocation('http://' . domain_name . '/act.php?func=boy'); } die; } } // Видимо тут уже игрок в игре if (defined("MODULE_ID")) { $result_func = checkFunc($user_id, MODULE_ID); if (!defined("NO_FUNC_CHECK")) { if ($result_func == 0) { $last_str = getRedirectFunc($user_id); setLocation('http://' . domain_name . '/' . $last_str . ''); die; } } } $map_name = $char['map_name']; $filelist = ",/combat.php,/arcomage.php,/chat/chat_online.php,/chat/chat_ajax.php,/combat/ajax.php,/chat/chat.php,/chat/chat_update.php,/admin.php,/lib/map_editor.php,/main.php,/lib/town.php,"; if (strpos($filelist, PHP_SELF) == false) { //сначала проверяем на автонападение ботов if ($char['func_id'] != func_craft and $char['func_id'] != func_combat and $char['func_id'] != func_arcomage and (close_combat != 1 or $user_id == 612) and $char['hide'] == 0) { $result = myquery("SELECT game_npc.id FROM game_npc,game_npc_template WHERE game_npc.npc_id=game_npc_template.npc_id AND game_npc.map_name =" . $char['map_name'] . " AND game_npc.xpos =" . $char['map_xpos'] . " AND game_npc.ypos =" . $char['map_ypos'] . " AND game_npc_template.agressive IN ('2','1') AND game_npc.time_kill+game_npc_template.respawn<UNIX_TIMESTAMP() AND (game_npc.for_user_id=0 OR game_npc.for_user_id={$user_id}) ORDER BY game_npc.HP"); if (mysql_num_rows($result) > 0) { while ($npc = mysql_fetch_array($result)) { $Npc = new Npc($npc['id']); $Npc->check_aggro($char); } } } }