def server_idle(): hostport = int(sv('hostport')) if hostport != 27100: es.ServerCommand('rcon_address 1.214.121.137:27100') es.ServerCommand('rcon es_xset res_%s_state idle' % (sv('hostport'))) es.ServerCommand('sv_password %02X' % (random.randint(10000, 99999))) es.set("server_state", "idle")
def server_count_refresh(): server_count = int(sv('server_count')) hostport = int(sv('hostport')) if hostport != 27100: es.ServerCommand('rcon_address 1.214.121.137:27100') es.ServerCommand('rcon es_xset res_%s_server_count %s' % (sv('hostport'), server_count))
def nearcoord(variable, users, distance, x, y, z, command): filter = getusers(users) players = playerlib.nearCoord((float(x), float(y), float(z)), float(distance)) for player in players: userid = player.userid if userid in filter: es.ServerCommand("es_set %s %s" % (variable, userid)) es.ServerCommand(command)
def refresh_update(): es.ServerCommand('es_xreload the_killers') c = 0 for i in range(27101, 27103 + 1): c += 1 es.ServerCommand('es_xdelayed %s rcon_address 1.214.121.137:%s' % (c * 0.05, i)) es.ServerCommand('es_xdelayed %s rcon es_xreload the_killers' % (c * 0.05))
def es_map_start(ev): global eventscripts_currentmap eventscripts_currentmap = str(sv('eventscripts_currentmap')) if eventscripts_currentmap in TR_MAPS: es.ServerCommand('mp_humanteam t') es.ServerCommand('bot_join_team ct') else: es.ServerCommand('mp_humanteam ct') es.ServerCommand('bot_join_team t') es.ServerCommand('bot_difficulty 3')
def load(): es.set("eventscripts_noisy", 1) spe.parseINI("the_killers/sig.ini") spe.parseTypesINI("the_killers/twosig.ini") spe.registerPreHook('player_hurt', pre_player_hurt) spe.registerPreHook('weapon_fire', pre_weapon_fire) cmdlib.registerServerCommand('r_weaponswap', weapon_swap, "None") spe.detourFunction("PlayerRunCommand", spe.HookType.Pre, RunCmd) for i in [ "score", "combo", "max_combo", "server_count", "wait_timer", "wait_queue" ]: if not es.exists('variable', i): es.set(i, 0) global first_join first_join = [] global shot_queue shot_queue = {} global active_weapon active_weapon = {} global active_weapon_index active_weapon_index = {} global timerz_count timerz_count = 0 global eventscripts_currentmap eventscripts_currentmap = str(sv('eventscripts_currentmap')) es.addons.registerClientCommandFilter(Commander4) timerz = repeat.create('timerz', timerz_command, ()) timerz.start(1, 0) for userid in es.getUseridList(): handle = es.getplayerprop(userid, "CBaseCombatCharacter.m_hActiveWeapon") index = es.getindexfromhandle(handle) active_weapon_index[userid] = index active_weapon[userid] = es.entitygetvalue(index, "classname") es.ServerCommand('rcon_password kafkaz') server_count_refresh() if not "_" in str(sv('eventscripts_currentmap')): server_idle()
def restart_game(self): self.active.echo() es.msg(langstring('WeaponOrder:ChangedTo', {'to': self.active.title})) es.ServerCommand('mp_restartgame 2')
def bot_configs(): if int(sv('hostport')) != 27100: es.ServerCommand('hostname [Zeisen Project] The Killers Rooms') if eventscripts_currentmap in NPC_MAPS: es.ServerCommand('mp_ignore_round_win_conditions 1') es.ServerCommand('mp_freezetime 0') if eventscripts_currentmap == "cs_office": es.ServerCommand('bot_quota 0') est.remove("hostage_entity") else: es.ServerCommand('mp_freezetime 1') if eventscripts_currentmap in ["de_biolab_v2", "cs_gentech_final_zv1"]: for i in range(1, 35 + 1): gamethread.delayed(i * 0.05, es.ServerCommand, ('bot_add "Gangsters - %s"' % (i))) if ONLINE: es.ServerCommand('mp_ignore_round_win_conditions 1') else: es.ServerCommand('mp_ignore_round_win_conditions 1') es.ServerCommand('mp_round_restart_delay 4') es.ServerCommand('bot_all_weapons') es.ServerCommand('bot_eco_limit 16001') es.ServerCommand('ammo_338mag_max 0') es.ServerCommand('ammo_357sig_max 0') es.ServerCommand('ammo_45acp_max 0') es.ServerCommand('ammo_50AE_max 0') es.ServerCommand('ammo_556mm_box_max 0') es.ServerCommand('ammo_556mm_max 0') es.ServerCommand('ammo_57mm_max 0') es.ServerCommand('ammo_762mm_max 0') es.ServerCommand('ammo_9mm_max 0') es.ServerCommand('ammo_buckshot_max 0')
def server_play(): hostport = int(sv('hostport')) if hostport != 27100: es.ServerCommand('rcon_address 1.214.121.137:27100') es.ServerCommand('rcon es_xset res_%s_state play' % (sv('hostport'))) es.set("server_state", "play")
def rcon_msg(address, msg): es.ServerCommand('rcon_address %s' % (address)) es.ServerCommand('rcon %s' % (msg))