def es_map_start(event_var): '''Method to be ran on es_map_start event''' # Make the sounds downloadable make_downloadable() # Load custom GunGame events gg_resource_file.load() # Execute GunGame's server.cfg file es.delayed(1, 'exec gungame51/gg_server.cfg') # Reset all players reset_players() # Reset current leaders LeaderManager().reset() # Prune the Database prune_winners_db() # Loop through all human players for userid in getUseridList('#human'): # Update players in winner's database Player(userid).database_update() # Is the weapon order sort type set to #random? if str(gg_weapon_order_sort_type) == '#random': # Re-randomize the weapon order get_weapon_order().randomize() # Check to see if gg_start needs fired after everything is loaded delayed(2, check_gg_start)
def es_map_start(event_var): # Get a list of files names in the weapon_orders directory files = [x.namebase for x in weaponOrderFilesTXT] # Get the current weapon order's file name currentFile = get_weapon_order().name # Remove the current weapon order's file name files.remove(str(currentFile)) # Do not choose from excluded weapon orders for excluded_file in str(gg_weapon_order_random_excluded).split(","): excluded_file = excluded_file.strip() if excluded_file in files: files.remove(excluded_file) # If the current weapon order is the only weapon order, return if not len(files): return # Get a random weapon order file newFile = random.choice(files) # Set the new file currentOrder = set_weapon_order(newFile) # Echo the new weapon order currentOrder.echo()