On a 32 slot server, the above would allow only five players to join the red team and 27 on the blue team. It would obviously need to disable auto team balance when enabled as well.
public Plugin:myinfo = { name = "Team Limiter", author = "Arkarr", description = "Allow to set a max limit of player in each team.", version = "1.0", url = "http://www.sourcemod.net" };
public OnPluginStart() { CVAR_plugin_stat = CreateConVar("sm_TL_playerlimit_enabled", "1", "Enable or disable plugin. VALUE : 1 = ENABLED 0 = DISABLED"); CVAR_limit_t1 = CreateConVar("sm_TL_playerlimit_team_1", "0", "Maxium player(s) in team 1. NOTE: team 1 include Terrorists/RED/?"); CVAR_limit_t2 = CreateConVar("sm_TL_playerlimit_team_2", "32", "Maxium player(s) in team 2. NOTE: team 2 include CounterTerrorists/BLU/?");
HookEvent("player_team", Event_PlayerTeam); }
public Action:Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast) { new client = GetClientOfUserId(GetEventInt(event, "userid"));