update sourcemod to the latest version
and another way to get a random terrorist:
PHP Code:
public int SelectTerrorist() {
ArrayList Terrorists = new ArrayList();
for(int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
if(GetClientTeam(i) == CS_TEAM_CT)
{
Terrorists.Push(i);
}
}
}
int index = Terrorists.Get(GetRandomInt(0, Terrorists.Length - 1));
delete Terrorists;
return index;
}
You can get an infinite loop with while and getrandomint.
__________________