Difference between revisions of "Lua:SmartClassLimits"

From Fortress Forever Wiki
Jump to navigationJump to search
m (LUA:SmartClassLimits moved to SmartClassLimits: LUA: prefix not needed.)
(No difference)

Revision as of 03:14, 2 December 2007

SmartClassLimits

SmartClassLimits is a way of simplifying SetTeamClassLimits. It must be placed in your map's startup() function and gets passed 11 parameters:

SmartClassLimits( team, scout, sniper, soldier, demoman, medic, hwguy, pyro, spy, engineer, civilian )
team     - team to set limits on
scout    - number of scouts allowed
sniper   - number of snipers allowed
soldier  - number of soldiers allowed
demoman  - number of demomen allowed
medic    - number of medics allowed
hwguy    - number of hwguys allowed
pyro     - number of pyros allowed
spy      - number of spies allowed
engineer - number of engineers allowed
civilian - number of civilians allowed

In this example, we will make red only have 2 snipers and blue not have any soldiers, plus eliminate the ability to have civilians on any team:

Example .LUA startup() function

function startup()
     -- Limit red to 2 snipers (and eliminate red civilians)
     SmartClassLimits( RED_TEAM, 0, 2, 0, 0, 0, 0, 0, 0, 0, -1 )

     -- Remove soldiers from blue team (and eliminate blue civilians)
     SmartClassLimits( BLUE_TEAM, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1 )

     -- Remove yellow civilians
     SmartClassLimits( YELLOW_TEAM, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 )

     -- Remove green civilians
     SmartClassLimits( GREEN_TEAM, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 )
end