thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: MasterAdmin (by Master_Jochen) [CoD4:5]  (Read 22119 times)

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
MasterAdmin (by Master_Jochen) [CoD4:5]
« on: December 12, 2009, 10:10:21 PM »
This plugin was 'released' in early 2008 by Master_Jochen, but in an obscure area of the forums.

Because of the impromptu code hacks that have been released in past days, I have taken the liberty of packaging and releasing Master_Jochens work. I can confirm that it works, it installs much like any other plugin.

Quote
This plugin was written by Master_Jochen.

The commands are as follows:

!gametype : Changes the gametype (eg !gametype war)
!hardcore : Turns hardcore on or off (eg !hardcore off)
!killcam : Turns the killcam on or off (eg !killcam on)
!ff : Turns friendly fire on, off, shared, reflect (eg !ff on)
!spectate : Turns spectator mode off, team, free (eg !spectate off)
!fastrestart : restarts the map without forcing all clients to reload
!mag : changes map and gametype. (eg !mag shipment dm (do not use mp_))

These commands work for the CoD series only, and have been verified to work on CoD4 and CoD5.

Download: http://www.bigbrotherbot.com/forums/downloads/?sa=view;down=48
« Last Edit: December 12, 2009, 11:42:55 PM by Courgette »

Offline xtoor

  • Jr. Member
  • **
  • Posts: 45
    • Master Rifle CLan
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #1 on: February 25, 2010, 07:28:06 PM »
this is tested on my CoD1 server working fine but i would like to ask a little modding for some gametypes like HQ, DEM and actf aka (ctf version of cod1) in COD1 thanks

Offline Wright

  • Full Member
  • ***
  • Posts: 133
  • eliteclangaming.com
    • Elite Gaming
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #2 on: March 17, 2010, 04:18:14 PM »
this is tested on my CoD1 server working fine but i would like to ask a little modding for some gametypes like HQ, DEM and actf aka (ctf version of cod1) in COD1 thanks
I can probably help you with this, I am the leader of Elite in 1.5. Add me on xfire blitzwright.
xfire: blitzwright

Offline Mikobiko

  • Sr. Member
  • ****
  • Posts: 250
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #3 on: May 14, 2010, 11:31:46 PM »
One minor issue with this plugin is the commands arent documented, they all said fast restart lol.

I went through and fixed it up. If somethings wrong feel free to let me know :)
Code: [Select]
#
# COD4 Admin Plugin for BigBrotherBot(B3) (www.bigbrotherbot.com)
#plugin developed by  www.international-freaks.de
#
# special thanks to xlr8or for code pieces and the help in the forum


__version__ = '1.0.0'
__author__  = 'Master_Jochen'

import b3, re, time
import b3.events

#-------------- done by xlr8or----------------------------------------------------------------------------
class MasteradminPlugin(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---------------------------------------------------------


  def cmd_fastrestart(self, data, client, cmd=None):
    """\
    - Perform a Fast Restart.
    """
    self.console.say('^2Fast map restart will be executed')
    time.sleep(2)
    self.console.write('fast_restart')
    return True
   
  def cmd_hardcore(self, data, client, cmd=None):
    """\
    <on/off> - Turns Hardcore on or off and performs a fast restart.
    """
    if not data:
      client.message('^7Missing data, type off or on behind the command')
      return False
    else:
      input = data.split(' ',1)
      if input[0] == 'on' :
          self.console.say('^2Gamemode set to^1 Hardcore')
          time.sleep(2)
          self.console.write('scr_hardcore 1')
          self.console.write('fast_restart')
          return True
      if input[0] == 'off' :
          self.console.say('^2Gamemode set to^1 Softcore')
          time.sleep(2)
          self.console.write('scr_hardcore 0')
          self.console.write('fast_restart')
          return True
      client.message('^7Invalid data, type off or on')   
    return True
       
  def cmd_ff(self, data, client, cmd=None):
    """\
    <on/off/shared/reflect> - Turns Friendly Fire on, off, shared, or reflect, and performs a fast restart.
    """
    if not data:
      client.message('^7Missing data, type off or on behind the command')
      return False
    else:
      input = data.split(' ',1)
      if input[0] == 'off' :
          self.console.say('^2Set Friendly Fire^1 Off')
          time.sleep(2)
          self.console.write('scr_team_fftype 0')
          self.console.write('fast_restart')
          return True
      if input[0] == 'on' :
          self.console.say('^2Set Friendly Fire^1 On')
          time.sleep(2)
          self.console.write('scr_team_fftype 1')
          self.console.write('fast_restart')
          return True
      if input[0] == 'shared' :
          self.console.say('^2Set Friendly Fire^1 Shared')
          time.sleep(2)
          self.console.write('scr_team_fftype 2')
          self.console.write('fast_restart')
          return True
      if input[0] == 'reflect' :
          self.console.say('^2Set Friendly Fire^1 Reflect')
          time.sleep(2)
          self.console.write('scr_team_fftype 3')
          self.console.write('fast_restart')
          return True
      client.message('^7Invalid data, type off,on,shared or reflect')   
    return True   
       
  def cmd_killcam(self, data, client, cmd=None):
    """\
    <on/off> - Turns Killcam on or off and performs a fast restart.
    """
    if not data:
      client.message('^7Missing data, type off or on behind the command')
      return False
    else:
      input = data.split(' ',1)
      if input[0] == 'on' :
          self.console.say('^2Killcam is now^1 On')
          time.sleep(2)
          self.console.write('scr_game_allowkillcam 1')
          self.console.write('fast_restart')
          return True
      if input[0] == 'off' :
          self.console.say('^2Killcam is now^1 Off')
          time.sleep(2)
          self.console.write('scr_game_allowkillcam 0')
          self.console.write('fast_restart')
          return True
          client.message('^7Invalid data, type off or on')   
    return True
   
  def cmd_gametype(self, data, client, cmd=None):
    """\
    <sab/sd/dm/tdm/hq> - Switches the game mode and performs a map restart.
    """
    if not data:
      client.message('^7Missing data, try sab,hq,sd,tdm,hq')
      return False
    else:
      input = data.split(' ',1)
      if input[0] == 'sab' :
          self.console.say('^2Gamtype set to^1 Sabotage')
          time.sleep(2)
          self.console.write('g_gametype "sab"')
          self.console.write('map_restart')
          return True
      if input[0] == 'sd' :
          self.console.say('^2Gamtype set to^1 Search and Destroy')
          time.sleep(2)
          self.console.write('g_gametype "sd"')
          self.console.write('map_restart')
          return True
      if input[0] == 'dm' :
          self.console.say('^2Gamtype set to^1 Death Match')
          time.sleep(2)
          self.console.write('g_gametype "dm"')
          self.console.write('map_restart')
          return True
      if input[0] == 'tdm' :
          self.console.say('^2Gamtype set to^1 Team Deathmatch')
          time.sleep(2)
          self.console.write('g_gametype "war"')
          self.console.write('map_restart')
          return True
      if input[0] == 'hq' :
          self.console.say('^2Gamtype set to^1 Headquater')
          time.sleep(2)
          self.console.write('g_gametype "koth"')
          self.console.write('map_restart')
          return True
      client.message('^7Invalid data, type sab,sd,dm,tdm,hq behind your command')         
    return True   
   
  def cmd_spectate(self, data, client, cmd=None):
    """\
    <off/team/free> - Sets Spectator mode and performs a fast restart.
    """
    if not data:
      client.message('^7Missing data, type a value behind the command')
      return False
    else:
      input = data.split(' ',1)
      if input[0] == 'off' :
          self.console.say('^2Set spectate to^1 Off')
          time.sleep(2)
          self.console.write('scr_game_spectatetype 0')
          self.console.write('fast_restart')
          return True
      if input[0] == 'team' :
          self.console.say('^2Set spectate to^1 Team')
          time.sleep(2)
          self.console.write('scr_game_spectatetype 1')
          self.console.write('fast_restart')
          return True
      if input[0] == 'free' :
          self.console.say('^2Set spectate to^1 Free')
          time.sleep(2)
          self.console.write('scr_game_spectatetype 2')
          self.console.write('fast_restart')
          return True
      client.message('^7Invalid data, type off,team or free')   
    return True

  def cmd_mag(self, data, client, cmd=None):
    """\
    <map> <gametype> - Performs a map and gametype switch, does not use mp_ in this.
    """
    if not data:
      client.message('^7Missing data, type off or on behind the command')
      return False
    else:
      input = data.split(' ',1) 
      map = input[0]
      input[0] = 'mp_%s'% input[0]
      #---------------------------------------
      if input[1] == 'tdm' : input[1] = 'war'
      if input[1] == 'hq' : input[1] = 'koth'
      #----------------------------------------
      if input[1] == 'sab' : gametype = 'Sabotage'
      if input[1] == 'war' : gametype = 'Team Deathmatch'
      if input[1] == 'koth' : gametype = 'Headquaters'
      if input[1] == 'sd' : gametype = 'Search and destroy'
      if input[1] == 'dm' : gametype = 'Deathmatch'
      if input[1] != '' :
          #self.console.say('^2Map will change to^3 %s ^2gametype^3 %s'% (map,gametype))
          self.console.say('^2Map will change to^3 %s,'% map)
          self.console.say('^2and the gametype to^3 %s'% gametype)
          time.sleep(2)
          self.console.say('^2Loading ^3%s ^2in^1 3'% map)
          time.sleep(1)
          self.console.say('^2Loading ^3%s ^2in^3 2'% map)
          time.sleep(1)
          self.console.write('g_gametype "%s"'% input[1])
          self.console.say('^2Loading ^3%s ^2in^4 1'% map)
          time.sleep(1)
          self.console.write('map %s'% input[0])
          return True   
    return True

Offline Witch

  • Full Member
  • ***
  • Posts: 116
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #4 on: May 22, 2010, 05:42:43 PM »
when it will be realise for urban terror  ;D ;D

Offline Export

  • Newbie
  • *
  • Posts: 1
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #5 on: June 03, 2010, 02:29:22 PM »
Hi, the !gametype domination is missing.
You can fix it by adding:
Code: [Select]
      
if input[0] == 'dom' :
          self.console.say('^2Gamtype set to^1 Domination')
          time.sleep(2)
          self.console.write('g_gametype "dom"')
          self.console.write('map_restart')
          return True

Thx for the plugin.

Offline foxinabox

  • Sr. Member
  • ****
  • Posts: 157
    • Clan ATRS (Atreides)
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #6 on: September 14, 2010, 06:11:39 PM »
Any chance that adding a command for cod4 so servers could be locked down with this plugin? like a !setsvrpass !delsvrpass  (just an idea)
xfire: foxinabox85
[email protected]
www.clanatrs.com

Offline SneakyChopstick

  • Newbie
  • *
  • Posts: 2
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #7 on: January 22, 2011, 06:10:34 AM »
Hi, this looks like a pretty awesome plugin but will it work it Call Of Duty Modern Warfare 2  ???
 Im already having troubles launching it haha :(

Offline gabarram

  • Sr. Member
  • ****
  • Posts: 186
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #8 on: February 02, 2011, 12:22:23 AM »

Offline feodor

  • Newbie
  • *
  • Posts: 6
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #9 on: February 10, 2011, 08:51:12 PM »
works with mw2 (alteriwnet). if u use the code modification for domination be sure to use the correct indentation as python is very strict with it...

Offline gabarram

  • Sr. Member
  • ****
  • Posts: 186
[Help]Adding gametypes for MW2 to masteradmin
« Reply #10 on: March 30, 2011, 05:50:18 PM »

Offline armdemon

  • Newbie
  • *
  • Posts: 7
Re: [Help]Adding gametypes for MW2 to masteradmin
« Reply #11 on: March 31, 2011, 07:55:34 AM »

Offline Platanos

  • Sr. Member
  • ****
  • Posts: 296
    • The Last Unit
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #12 on: March 31, 2011, 01:58:27 PM »
you can use my file, i add some Gametypes

LG

[attachment deleted by maintenance]

Offline gabarram

  • Sr. Member
  • ****
  • Posts: 186
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #13 on: March 31, 2011, 03:28:02 PM »

Offline amonx

  • Newbie
  • *
  • Posts: 5
Re: MasterAdmin (by Master_Jochen) [CoD4:5]
« Reply #14 on: April 12, 2011, 08:41:53 PM »
hey guys by any chance can you add oldschool mode for cod4 in this plugin plz?

or cluses..for me to do it myself
thanks
Am0Nx

 


Rate this page +1 at Google Search