1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need a No Commander script

Discussion in 'Off Topic' started by legayo, May 3, 2011.

  1. legayo

    legayo New Member

    hi.. today i post here becouse i hate commanders in small-size maps and if someone help me posting a script who disable commander mode [completely] i will be grateful :)
  2. Krauzi

    Krauzi Member

    you cannot dissable the commander without creating a mod (and disable the button there).
    The only thing you can do is warn and kick players who are commanders.
    Im not at home right know so i cannot help you much, but this site could help you out:
  3. SharK

    SharK Member

    What you do not like the script?
    # Commander Kill System
    # Module: comdis.py
    # Author: REW
    # Version: 1.0
    import bf2
    import host
    import mm_utils
    from bf2.stats.constants import *
    from bf2 import g_debug
    #debug flag
    sks_debug = False # for verbose server console messages
    #variable settings; intervals are in seconds
    minP = 10 # max players for 'no commanders' mode
    killInterval = 5 # time before a commander is killed
    msgInterval = 90 # time between warning messages
    msgTimer = None
    #queue lists
    killList = []
    __version__ = 1.0
    __required_modules__ = {
    'modmanager': 1.2
    __supports_reload__ = True
    __description__ = "ModManager Commander Killer v%s" % __version__
    class ComDis( object ):
    def __init__( self, modManager ):
    # ModManager reference
    self.mm = modManager
    self.__state = 0
    # Initialize the kill system i.e. register game hooks.
    def init( self ):
    if 0 == self.__state:
    host.registerHandler('PlayerSpawn', self.onPlayerSpawn, 1)
    #host.registerHandler('EnterVehicle', self.onEnterVehicle, 1)
    host.registerHandler('ChangedCommander', self.onChangedCommander, 1)
    self.__state = 1
    def onChangedCommander(self, team, oldCmd, newCmd):
    # On spawn, checks if the player is a commander.
    # Player is added to kill list if player is a commander.
    def onPlayerSpawn(self, p, vehicle):
    # On enter vehicle, checks if the any player is a commander.
    # Player is added to kill list if player is a commander.
    def onEnterVehicle( self, p, vehicle, freeSoldier):
    def CheckForCommander( self ):
    global sks_debug
    global killList, killInterval, minP
    players = bf2.playerManager.getPlayers()
    numP = bf2.playerManager.getNumberOfPlayers()
    for pl in players:
    if pl.isCommander() and numP
  4. legayo

    legayo New Member

    maybe ill take shark's script.. i hate BF2 old school it only works with PB...wagg but maybe someone can help me modding?? to disable the button like WYD Elite Snipers Server at V1.0
  5. legayo

    legayo New Member

    ohhhhhhhh i've found the magic key people!!!!!

    i've searching at the folders of the server and i found this archive at %Battlefield2serverRoot%/mods/bf2/phyton/game/gamemodes/gpm_cq.py at line 28 and 30
    host.sh_setEnable_Commander (1) [original] and i set it to 0 and vualà commander mode eliminated!!!!!