Quote:
Originally Posted by Ilusion9
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.
|
I updated SM and used your selection function, thank you for that <3, but I am still experiencing the server crash after slaying a player who is last alive. Any other ideas would be greatly appreciated!
__________________