(this is my first plugin release)
Tired of playing CTF matches that have more snipers then scouts?
Want something done about all of those heavy/medic teams spawn-camping your base?
Don't want to completely disable specific classes on your server?
Well you're not alone.
Add this plugin to "discourage" class stacking.
it's completely configurable through cvars:
sm_SlapTheStackers_MinPlayers : Min number of players per team in order to slap them (Min:0, Max:, Default:4, NB:zero disables slapping)
sm_SlapTheStackers_Interval : How often (in seconds) to slap the class stackers. (Min:0.1, Max:300, Default:0.5)
sm_SlapTheStackers_Damage : How much slap damage players recieve. (Min:0, Max:300, Default:1)
sm_SlapTheStackers_PercentageScale : TeamClassCountLimit = RoundUp( (NumTeamPlayers / 9Classes) * ThisValue ); (Min:0.1, Max:0.9, Default:0.15)
Code:
TeamClassCountLimit = RoundUp( (NumTeamPlayers / 9Classes) * PercentageScaleValue )
>> During testing, using a fixed percentage value wouldn't work properly
>> so this formula was designed to scale the class percentage as players join/leave teams.
Examples (Warning! advanced math, it may make your head explode!):
>> Using a scale value of 0.1
>>>> 0.1 * (4Players / 9Classes = 0.4~) = 0.40 (40% of 4 players rounded up = 1ClassLimit)
>>>> 0.1 * (16Players / 9Classes = 1.7~) = 0.17 (17% of 16 players rounded up = 3ClassLimit)
>>>>>> All players exceeding this class limit count will be slapped.
>> Using a scale value of 0.15
>>>> 0.15 * (4Players / 9Classes = 0.4~) = 0.6 (60% of 4 players rounded up = 1ClassLimit)
>>>> 0.15 * (16Players / 9Classes = 1.7~) = 0.255 (25.5% of 16 players rounded up = 4ClassLimit)
>>>>>> All players exceeding this class limit count will be slapped.
>> Using a scale value of 0.2
>>>> 0.2 * (4Players / 9Classes = 0.4~) = 0.80 (80% of 4 players rounded up = 1ClassLimit)
>>>> 0.2 * (16Players / 9Classes = 1.7~) = 0.34 (34% of 16 players rounded up = 6ClassLimit)
>>>>>> All players exceeding this class limit count will be slapped.