You can try this: (at your own risk)
Go to your /Battlefield 2/ folder and navigate to /mods/fh2/python/game/plugins/
In the /plugins folder create an empty .txt file.
Copy this code into the text file:
import bf2
import host
import bf2.Timer
from game.gameplayPlugin import base
import game.utilities as game
chairTemplates = [
'gercommradio',
'britcommradio',
'aecdorchester_passenger',
'aecdorchester_de_passenger',
'aecdorchester_france_passenger',
'storch_france_rearspotter',
'storch_trop_rearspotter',
'pipercub_gb_frontspotter',
'pipercub_us_frontspotter',
'sdkfz250_3_commander']
SPAM_TIME = 9
# Change The next Line to "ALWAYS_ENABLE = False" If you want to go back to normal FH2 Commander
ALWAYS_ENABLE = True
class commanderChair(base):
def __init__(self):
self.timer = None
self.ids = []
def round_start(self, hooker):
hooker.register('EnterVehicle', self.enterhook)
hooker.register('ExitVehicle', self.exithook)
hooker.register('PlayerDeath', self.deathhook)
hooker.register('ChangedCommander', self.chcomhook)
def round_end(self, hooker):
self.ids = []
if self.timer:
self.timer.destroy()
self.timer = None
def deathhook(self, player, soldier):
if not ALWAYS_ENABLE:
self.removeplayer(player)
def chcomhook(self, teamid, old_commander, new_commander):
if old_commander:
self.removeplayer(old_commander)
if new_commander:
if not ALWAYS_ENABLE:
self.removeplayer(new_commander)
else:
if self.timer == None:
self.timer = bf2.Timer(self.rankevent, SPAM_TIME, 1)
self.timer.setRecurring(SPAM_TIME)
self.ids.append(new_commander.index)
self.rankevent(0)
def enterhook(self, player, vehicle, *args):
if not ALWAYS_ENABLE:
if vehicle.templateName.lower() not in chairTemplates:
return None
if player.isCommander():
if self.timer == None:
self.timer = bf2.Timer(self.rankevent, SPAM_TIME, 1)
self.timer.setRecurring(SPAM_TIME)
self.ids.append(player.index)
self.rankevent(0)
def exithook(self, player, vehicle):
if not ALWAYS_ENABLE:
if vehicle.templateName.lower() not in chairTemplates:
return None
if player.isCommander():
self.removeplayer(player)
def removeplayer(self, player):
if player.index in self.ids:
self.ids.remove(player.index)
if len(self.ids) == 0:
if self.timer:
self.timer.destroy()
self.timer = None
def rankevent(self, ignore):
for id in self.ids:
host.sgl_sendRankEvent(id, 1, 2)
Rename the file to "commanderChair.py"
Now you should be able to command also while not in a radio.
If you want to revert back to the old way, replace "ALWAYS_ENABLE = True" with "ALWAYS_ENABLE = False". It will also go back if you delete the commanderChair.py file (don't delete the .pyc file!)
Note that this has no effect if you join a multiplayer server, so you don't have to be afraid of getting kicked for modified content.