[Release] FDOadmin plugin for B3 (v1.04)
Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Используя этот сайт, вы соглашаетесь Условия использования.
Ok, I had this laying around here for some time already, and both revision 108 of IW4M (onelog) and revision 22 of IW5M (exec command support) were good excuses to release it now
This is an admin plugin that focuses on adding IW4M and IW5M console commands to B3 in-game rcon.
At this stage, this plugin is deep in a beta stage (just added some commands as I felt like I needed them)
I'll be adding more commands in the future, and simplifying it's prefixes.
Note that I'm releasing here the full plugin, although some commands will only work on IW4M and some others on IW5M (stuff like fs_game for IW4M or loadscript for IW5M)
Anyway, you'll notice what are the available commands, just by looking at the xml code.
Changelog:
So, what we need to do is:
Add this line on "b3.xml":
Now save this file as "b3\extplugins\conf\plugin_Fdoadmin.xml":
Finally, save this file as "b3\extplugins\Fdoadmin.py":
# # FourDeltaOne Admin Plugin for BigBrotherBot(B3) (www.bigbrotherbot.com) # # The purpose of this plugin is to expand b3 admin control # over FourDeltaOne dedicated servers # # this plugin is based on Master_Jochen's "masteradmin" plugin __version__ = '1.04' __author__ = 'Paulofonta' #implying that I can actually code... lol import b3, re, time import b3.events #-------------- done by xlr8or---------------------------------------------------------------------------- class FdoadminPlugin(b3.plugin.Plugin): _adminPlugin = None def startup(self): """\ Initialize plugin settings """ # get the admin plugin so we can register commands self._adminPlugin = self.console.getPlugin('admin') if not self._adminPlugin: # something is wrong, can't start without admin plugin self.error('Could not find admin plugin') return False # register our commands if 'commands' in self.config.sections(): for cmd in self.config.options('commands'): level = self.config.get('commands', cmd) sp = cmd.split('-') alias = None if len(sp) == 2: cmd, alias = sp func = self.getCmd(cmd) if func: self._adminPlugin.registerCommand(self, cmd, level, func, alias) self.debug('Started') def getCmd(self, cmd): cmd = 'cmd_%s' % cmd if hasattr(self, cmd): func = getattr(self, cmd) return func return None def onEvent(self, event): """\ Handle intercepted events """ # Commands implementation - done by Master_Jochen / expanded by Paulofonta def cmd_fastrestart(self, data, client, cmd=None): self.console.say('^2Fast restart upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('fast_restart') return True def cmd_maprestart(self, data, client, cmd=None): self.console.say('^2Map will restart upon admin request, ^1in 5') time.sleep(1) self.console.say('^1 4') time.sleep(1) self.console.say('^1 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map_restart') return True def cmd_cmap(self, data, client, cmd=None): if not data: client.message('^7and the map is...?') return False else: input = data.split(' ',1) #IW4M-maps---------------------------------------------------------------------- if input[0] == 'afghan' : self.console.say('^2Changing to map ^1Afghan^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_afghan') return True if input[0] == 'scrapyard' : self.console.say('^2Changing to map ^1Scrapyard^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_boneyard') return True if input[0] == 'wasteland' : self.console.say('^2Changing to map ^1Wasteland^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_brecourt') return True if input[0] == 'karachi' : self.console.say('^2Changing to map ^1Karachi^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_checkpoint') return True if input[0] == 'derail' : self.console.say('^2Changing to map ^1Derail^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_derail') return True if input[0] == 'estate' : self.console.say('^2Changing to map ^1Estate^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_estate') return True if input[0] == 'favela' : self.console.say('^2Changing to map ^1Favela^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_favela') return True if input[0] == 'highrise' : self.console.say('^2Changing to map ^1Highrise^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_highrise') return True if input[0] == 'invasion' : self.console.say('^2Changing to map ^1Invasion^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_invasion') return True if input[0] == 'skidrow' : self.console.say('^2Changing to map ^1Skidrow^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_nightshift') return True if input[0] == 'quarry' : self.console.say('^2Changing to map ^1Quarry^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_quarry') return True if input[0] == 'rundown' : self.console.say('^2Changing to map ^1Rundown^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_rundown') return True if input[0] == 'rust' : self.console.say('^2Changing to map ^1Rust^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_rust') return True if input[0] == 'subbase' : self.console.say('^2Changing to map ^1Sub Base^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_subbase') return True if input[0] == 'sub' : self.console.say('^2Changing to map ^1Sub Base^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_subbase') return True if input[0] == 'underpass' : self.console.say('^2Changing to map ^1Underpass^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_underpass') return True #IW4M-DLC--------------------------------------------------------------------- if input[0] == 'carnival' : self.console.say('^2Changing to map ^1Carnival^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_abandon') return True if input[0] == 'salvage' : self.console.say('^2Changing to map ^1Salvage^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_compact') return True if input[0] == 'bailout' : self.console.say('^2Changing to map ^1Bailout^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_complex') return True if input[0] == 'crash' : self.console.say('^2Changing to map ^1Crash^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_crash') return True if input[0] == 'fuel' : self.console.say('^2Changing to map ^1Fuel^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_fuel2') return True if input[0] == 'overgrown' : self.console.say('^2Changing to map ^1Overgrown^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_overgrown') return True if input[0] == 'storm' : self.console.say('^2Changing to map ^1Storm^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_storm') return True if input[0] == 'strike' : self.console.say('^2Changing to map ^1Strike^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_strike') return True if input[0] == 'trailerpark' : self.console.say('^2Changing to map ^1Trailer Park^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_trailerpark') return True if input[0] == 'trailer' : self.console.say('^2Changing to map ^1Trailer Park^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_trailerpark') return True if input[0] == 'vacant' : self.console.say('^2Changing to map ^1Vacant^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_vacant') return True #Terminal-(IW4M-and-IW5M)----------------------------------------------------- if input[0] == 'terminal' : self.console.say('^2Changing to map ^1Terminal^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_terminal') self.console.write('map mp_terminal_cls') return True #IW5M-maps-------------------------------------------------------------------- if input[0] == 'lockdown' : self.console.say('^2Changing to map ^1Lockdown^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_alpha') return True if input[0] == 'bootleg' : self.console.say('^2Changing to map ^1Bootleg^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_bootleg') return True if input[0] == 'mission' : self.console.say('^2Changing to map ^1Mission^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_bravo') return True if input[0] == 'carbon' : self.console.say('^2Changing to map ^1Carbon^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_carbon') return True if input[0] == 'dome' : self.console.say('^2Changing to map ^1Dome^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_dome') return True if input[0] == 'downturn' : self.console.say('^2Changing to map ^1Downturn^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_exchange') return True if input[0] == 'hardhat' : self.console.say('^2Changing to map ^1Hardhat^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_hardhat') return True if input[0] == 'interchange' : self.console.say('^2Changing to map ^1Interchange^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_interchange') return True if input[0] == 'fallen' : self.console.say('^2Changing to map ^1Fallen^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_lambeth') return True if input[0] == 'bakaara' : self.console.say('^2Changing to map ^1Bakaara^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_mogadishu') return True if input[0] == 'resistance' : self.console.say('^2Changing to map ^1Resistance^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_paris') return True if input[0] == 'arkaden' : self.console.say('^2Changing to map ^1Arkaden^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_plaza2') return True if input[0] == 'outpost' : self.console.say('^2Changing to map ^1Outpost^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_radar') return True if input[0] == 'seatown' : self.console.say('^2Changing to map ^1Seatown^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_seatown') return True if input[0] == 'underground' : self.console.say('^2Changing to map ^1Underground^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_underground') return True if input[0] == 'village' : self.console.say('^2Changing to map ^1Village^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_village') return True #IW5M-DLC-------------------------------------------------------------------- if input[0] == 'aground' : self.console.say('^2Changing to map ^1Aground^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_aground_ss') return True if input[0] == 'boardwalk' : self.console.say('^2Changing to map ^1Boardwalk^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_boardwalk') return True if input[0] == 'u-turn' : self.console.say('^2Changing to map ^1U-Turn^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_burn_ss') return True if input[0] == 'uturn' : self.console.say('^2Changing to map ^1U-Turn^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_burn_ss') return True if input[0] == 'foundation' : self.console.say('^2Changing to map ^1Foundation^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_cement') return True if input[0] == 'erosion' : self.console.say('^2Changing to map ^1Erosion^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_courtyard_ss') return True if input[0] == 'intersection' : self.console.say('^2Changing to map ^1Intersection^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_crosswalk_ss') return True if input[0] == 'getaway' : self.console.say('^2Changing to map ^1Getaway^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_hillside_ss') return True if input[0] == 'piazza' : self.console.say('^2Changing to map ^1Piazza^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_italy') return True if input[0] == 'sanctuary' : self.console.say('^2Changing to map ^1Sanctuary^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_meteora') return True if input[0] == 'gulch' : self.console.say('^2Changing to map ^1Gulch^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_moab') return True if input[0] == 'blackbox' : self.console.say('^2Changing to map ^1Black Box^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_morningwood') return True if input[0] == 'black' : self.console.say('^2Changing to map ^1Black Box^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_morningwood') return True if input[0] == 'parish' : self.console.say('^2Changing to map ^1Parish^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_nola') return True if input[0] == 'overwatch' : self.console.say('^2Changing to map ^1Overwatch^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_overwatch') return True if input[0] == 'liberation' : self.console.say('^2Changing to map ^1Liberation^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_park') return True if input[0] == 'oasis' : self.console.say('^2Changing to map ^1Oasis^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_qadeem') return True if input[0] == 'lookout' : self.console.say('^2Changing to map ^1Lookout^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_restrepo_ss') return True if input[0] == 'offshore' : self.console.say('^2Changing to map ^1Off Shore^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_roughneck') return True if input[0] == 'off' : self.console.say('^2Changing to map ^1Off Shore^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_roughneck') return True if input[0] == 'decommission' : self.console.say('^2Changing to map ^1Decommission^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_shipbreaker') return True if input[0] == 'vortex' : self.console.say('^2Changing to map ^1Vortex^2, upon admin request, ^1in 3') time.sleep(1) self.console.say('^1 2') time.sleep(1) self.console.say('^1 1') time.sleep(1) self.console.write('map mp_six_ss') return True client.message('^7You have to use map names with this command (in lower cases)') return True def cmd_hardcore(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=off or 1=on after the command') return False else: input = data.split(' ',1) if input[0] == '1' : self.console.say('^2Hardcore ^1ON') self.console.write('g_hardcore 1') return True if input[0] == '0' : self.console.say('^2Hardcore ^1OFF') self.console.write('g_hardcore 0') return True client.message('^7Invalid data, type 1=on or 0=off') return True def cmd_killstreaks(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=off or 1=on after the command') return False else: input = data.split(' ',1) if input[0] == '1' : self.console.say('^2Killstreaks will now be ^1available') self.console.write('scr_game_hardpoints 1') return True if input[0] == '0' : self.console.say('^2Killstreaks will now be ^1UNavailable') self.console.write('scr_game_hardpoints 0') return True client.message('^7Invalid data, type 1=on or 0=off') return True def cmd_ff(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=off, 1=on, 2=reflected or 3=shared after the command') return False else: input = data.split(' ',1) if input[0] == '0' : self.console.say('^2Friendly Fire will now be ^1Off') time.sleep(1) self.console.write('scr_team_fftype 0') return True if input[0] == '1' : self.console.say('^2Friendly Fire will now be ^1On') time.sleep(1) self.console.write('scr_team_fftype 1') return True if input[0] == '2' : self.console.say('^2Friendly Fire will now be ^1Reflected') time.sleep(1) self.console.write('scr_team_fftype 2') return True if input[0] == '3' : self.console.say('^2Friendly Fire will now be ^1Shared') time.sleep(1) self.console.write('scr_team_fftype 3') return True client.message('^7Invalid data, type 0=off, 1=on, 2=reflected or 3=shared') return True def cmd_killcam(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=off or 1=on after the command') return False else: input = data.split(' ',1) if input[0] == '1' : self.console.say('^2Killcam will now be ^1On') time.sleep(2) self.console.write('scr_game_allowkillcam 1') return True if input[0] == '0' : self.console.say('^2Killcam will now be ^1Off') time.sleep(2) self.console.write('scr_game_allowkillcam 0') return True client.message('^7Invalid data, type 0=off or 1=on') return True def cmd_gametype(self, data, client, cmd=None): if not data: client.message('^7Specify a valid gametype after the command') return False else: self.console.say('^2Gametype will change to ^1 %s' % data) time.sleep(1) self.console.write('g_gametype %s' % data) return True return True def cmd_spectate(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=Off, 1=Team, or 2=Free after the command') return False else: input = data.split(' ',1) if input[0] == '0' : self.console.say('^2Spectate type set to ^1Off') time.sleep(1) self.console.write('scr_game_spectatetype 0') return True if input[0] == '1' : self.console.say('^2Spectate type set to ^1Team') time.sleep(1) self.console.write('scr_game_spectatetype 1') return True if input[0] == '2' : self.console.say('^2Spectate type set to ^1Free') time.sleep(1) self.console.write('scr_game_spectatetype 2') return True client.message('^7Invalid data, type 0=off, 1=team or 2=free') return True def cmd_balance(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=off or 1=on after the command') return False else: input = data.split(' ',1) if input[0] == '1' : self.console.say('^2Team balancing will now be ^1On') time.sleep(2) self.console.write('scr_teambalance 1') return True if input[0] == '0' : self.console.say('^2Team balancing will now be ^1Off') time.sleep(2) self.console.write('scr_teambalance 0') return True client.message('^7Invalid data, type 0=off or 1=on') return True def cmd_exec(self, data, client, cmd=None): self.console.say('^2Server config will be executed') time.sleep(1) self.console.write('exec %s' % data) return True def cmd_maprotation(self, data, client, cmd=None): self.console.say('^2Server playlist ^1%s^2 loaded' % data) time.sleep(1) self.console.write('sv_maprotation %s' % data) return True def cmd_password(self, data, client, cmd=None): self.console.say('^2Server password changed') self.console.write('g_password ""') time.sleep(1) self.console.write('g_password %s' % data) return True def cmd_hostname(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2Server name changed to to ^7 %s' % data) time.sleep(1) self.console.write('sv_hostname %s' % data) return True return True def cmd_maxclients(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2Server will support^1 %s ^2players after map load' % data) time.sleep(1) self.console.write('sv_maxclients %s' % data) return True return True def cmd_allowvote(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=Disabled or 1=Available after the command') return False else: input = data.split(' ',1) if input[0] == '1' : self.console.say('^2Voting will now be ^1Available') time.sleep(2) self.console.write('g_allowvote 1') return True if input[0] == '0' : self.console.say('^2Voting will now be ^1Disabled') time.sleep(2) self.console.write('g_allowvote 0') return True client.message('^7Invalid data, type 0=Disabled or 1=Available') return True def cmd_voice(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=Off, 1=Free, or 2=Team after the command') return False else: input = data.split(' ',1) if input[0] == '0' : self.console.say('^2You have the right to remain ^1Silent') time.sleep(1) self.console.write('sv_voice 0') return True if input[0] == '1' : self.console.say('^2You can now voice chat with ^1Everyone') time.sleep(1) self.console.write('sv_voice 1') return True if input[0] == '2' : self.console.say('^2You can now voice chat with your ^1Team') time.sleep(1) self.console.write('sv_voice 2') return True client.message('^7Invalid data, type 0=Off, 1=Free or 2=Team') return True def cmd_deadchat(self, data, client, cmd=None): if not data: client.message('^7Missing data, type 0=off or 1=on after the command') return False else: input = data.split(' ',1) if input[0] == '1' : self.console.say('^2Dead people ^1can now talk') time.sleep(2) self.console.write('g_deadchat 1') return True if input[0] == '0' : self.console.say('^2Dead people ^1dont talk') time.sleep(2) self.console.write('g_deadchat 0') return True client.message('^7Invalid data, type 0=off or 1=on') return True def cmd_mod(self, data, client, cmd=None): self.console.say('^1 %s ^2loaded' % data) time.sleep(1) self.console.write('fs_game %s' % data) return True def cmd_script(self, data, client, cmd=None): self.console.say('^1 %s ^2loaded' % data) time.sleep(1) self.console.write('loadscript %s' % data) return True def cmd_unscript(self, data, client, cmd=None): self.console.say('^1 %s ^2UNloaded' % data) time.sleep(1) self.console.write('unloadscript %s' % data) return True def cmd_maxhealth(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2MaxHealth set to ^1 %s' % data) time.sleep(1) self.console.write('scr_player_maxhealth %s' % data) return True return True def cmd_regentime(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2Health Regen Time set to ^1 %s' % data) time.sleep(1) self.console.write('scr_player_healthregentime %s' % data) return True return True #------------------ gametype based commands ------------------------ # scorelimit def cmd_arenascorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_arena_scorelimit %s' % data) return True return True def cmd_ctfscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_ctf_scorelimit %s' % data) return True return True def cmd_confscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_conf_scorelimit %s' % data) return True return True def cmd_demscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_dd_scorelimit %s' % data) return True return True def cmd_ffascorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_dm_scorelimit %s' % data) return True return True def cmd_domscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_dom_scorelimit %s' % data) return True return True def cmd_grndscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_grnd_scorelimit %s' % data) return True return True def cmd_gtnwscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_gtnw_scorelimit %s' % data) return True return True def cmd_gunscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_gun_scorelimit %s' % data) return True return True def cmd_headscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_koth_scorelimit %s' % data) return True return True def cmd_juggscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_jugg_scorelimit %s' % data) return True return True def cmd_ofscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_oneflag_scorelimit %s' % data) return True return True def cmd_oicscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_oic_scorelimit %s' % data) return True return True def cmd_sabscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_sab_scorelimit %s' % data) return True return True def cmd_sdscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_sd_scorelimit %s' % data) return True return True def cmd_tdefscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_tdef_scorelimit %s' % data) return True return True def cmd_tdmscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_war_scorelimit %s' % data) return True return True def cmd_tjuggscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_tjugg_scorelimit %s' % data) return True return True def cmd_vipscorelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2ScoreLimit set to ^1 %s ^2points' % data) time.sleep(1) self.console.write('scr_vip_scorelimit %s' % data) return True return True # timelimit def cmd_arenatimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_arena_timelimit %s' % data) return True return True def cmd_conftimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_conf_timelimit %s' % data) return True return True def cmd_ctftimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_ctf_timelimit %s' % data) return True return True def cmd_demtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_dd_timelimit %s' % data) return True return True def cmd_ffatimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_dm_timelimit %s' % data) return True return True def cmd_domtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_dom_timelimit %s' % data) return True return True def cmd_grndtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_grnd_timelimit %s' % data) return True return True def cmd_gtnwtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_gtnw_timelimit %s' % data) return True return True def cmd_guntimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_gun_timelimit %s' % data) return True return True def cmd_headtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_koth_timelimit %s' % data) return True return True def cmd_inftimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_infect_timelimit %s' % data) return True return True def cmd_juggtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_jugg_timelimit %s' % data) return True return True def cmd_oftimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_oneflag_timelimit %s' % data) return True return True def cmd_oictimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_oic_timelimit %s' % data) return True return True def cmd_sabtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_sab_timelimit %s' % data) return True return True def cmd_sdtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_sd_timelimit %s' % data) return True return True def cmd_tdeftimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_tdef_timelimit %s' % data) return True return True def cmd_tdmtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_war_timelimit %s' % data) return True return True def cmd_tjuggtimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_tjugg_timelimit %s' % data) return True return True def cmd_viptimelimit(self, data, client, cmd=None): if not data: client.message('^7Specify a value after the command') return False else: self.console.say('^2TimeLimit set to ^1 %s ^2minutes' % data) time.sleep(1) self.console.write('scr_vip_timelimit %s' %data) return True return True #------------------- end of gametype based commands ----------------Note that this is an initial release and there might be some bugs, since most of the work was copy-paste, edit
Also note that this code isn't "nab-proof". If you type something like "!g_gametype tdm", it will tell you that "gametype will change to tdm", but it won't change anything, because the server only recognizes tdm gametype as "war". So, to change the gametype to tdm, you have to input "!gametype war".
I would thank you if you report any bug, or suggest any command to be added.
One last thing about using this plugin with IW5M servers:
I've open a topic on IW4M section, to discuss IW4M specific stuff on this plugin -> http://fourdeltaone.net/viewtopic.php?f=17&t=17663
Finally, as the credits on the python file mention, credits go for xlr8or for starting all b3 coding, and Master_Jochen, since I started this plugin using his "masteradmin" plugin code as base.