def end_warmup(self): '''Ends the current Warmup Round''' # Is Warmup Round currently active? if not info.name in PriorityAddon: # If not, there is no need to end the Warmup Round return # Send stop command to repeat loop self.repeat.stop() # Send hudhint to players that Warmup has ended hudhint('#human', self.message) # Remove Priority Addons self.priorities.clear() # Reset the number of extensions self.extensions = 0 # Reset mp_freezetime mp_freezetime.set(self.freezetime) # Execute the End Warmup Round cfg file es.mexec('gungame51/' + str(warmup_end_file)) # Restart the game es.server.queuecmd('mp_restartgame 1') # Set all living players godmode value to True self.set_all_players_godmode(True) # After a 1 second delay, clean up this Warmup Round delayed(1, self.clean_up)
def start_warmup(self): '''Called when Warmup Round needs to start''' # Add Warmup Round to PriorityAddon self.priorities.add(info.name) # Set the Warmup Message self.message = 'Timer_Ended' # Store a backup of mp_freezetime self.freezetime = int(mp_freezetime) # Set Freeze Time to 0 mp_freezetime.set(0) # Execute the Start Warmup Round cfg es.mexec('gungame51/' + str(warmup_start_file)) # Get the Warmup Weapon self.weapon = self.set_warmup_weapon() # Start the count down self.repeat.start(1, int(warmup_timer)) # Loop through all living players for player in getPlayerList('#alive'): # Give the player the warmup weapon self.give_warmup_weapon(player.userid) # Wait until adding other PriortyAddons delayed(0.1, self.add_priority_addons)
def end_warmup(self): """Ends the current Warmup Round""" # Is Warmup Round currently active? if not info.name in PriorityAddon: # If not, there is no need to end the Warmup Round return # Send stop command to repeat loop self.repeat.stop() # Send hudhint to players that Warmup has ended hudhint("#human", self.message) # Remove Priority Addons self.priorities.clear() # Reset the number of extensions self.extensions = 0 # Reset mp_freezetime mp_freezetime.set(self.freezetime) # Execute the End Warmup Round cfg file es.mexec("gungame51/" + str(warmup_end_file)) # Restart the game es.server.queuecmd("mp_restartgame 1") # Set all living players godmode value to True self.set_all_players_godmode(True) # After a 1 second delay, clean up this Warmup Round delayed(1, self.clean_up)
def start_warmup(self): """Called when Warmup Round needs to start""" # Add Warmup Round to PriorityAddon self.priorities.add(info.name) # Set the Warmup Message self.message = "Timer_Ended" # Store a backup of mp_freezetime self.freezetime = int(mp_freezetime) # Set Freeze Time to 0 mp_freezetime.set(0) # Execute the Start Warmup Round cfg es.mexec("gungame51/" + str(warmup_start_file)) # Get the Warmup Weapon self.weapon = self.set_warmup_weapon() # Start the count down self.repeat.start(1, int(warmup_timer)) # Loop through all living players for player in getPlayerList("#alive"): # Give the player the warmup weapon self.give_warmup_weapon(player.userid) # Wait until adding other PriortyAddons delayed(0.1, self.add_priority_addons)
def _execute_cfg_files(self): '''Executes all .cfg files on load''' # Loop through all config files for cfg in ConfigInstances: # Execute the configs es.mexec('gungame51' + cfg.cfgpath.rsplit('gungame51', 1)[1]) # Delay 1 tick to allow all cfg files to be executed delayed(0, self._reload_addons)
def execute(self, queuecmd=False): """ Executes the config """ es.mexec('..' + self.cfgpath.replace(self.gamedir, '', 1))