PHP Code:
#include <amxmodx>
#include <cstrike>
new PLUGIN[] = "Teamchanger"
new AUTHOR[] = "Schwabba"
new VERSION[] = "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(5.0,"CTcheck",0,_,_,"b")
}
public CTcheck( )
{
new iPlayers[32],iNum, Cts, Ts
get_players(iPlayers, Ts, "e", "TERRORIST");
get_players(iPlayers, iNum)
for(new i=0;i<iNum;i++)
{
new plr = iPlayers[i]
if(cs_get_user_team(plr) == CS_TEAM_CT)
{
Cts++
if (Cts > Ts/3 && Cts > 2)
{
new snick[32];
get_user_name(plr, snick, 31);
cs_set_user_team(plr, CS_TEAM_T)
client_print(0, print_chat, "There are to many Ct's, %s got switched to the T's", snick);
// Remove '//' on the line below to slay the switched player.
// set_user_health(plr, 0)
}
}
}
}
Ok now there can be 2 CT's all the time.
When there are 3 CT's, then 1 CT get moved to the T's until the T's are 9 or more players, same with 12 T's and 4 CT's.