View Single Post
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-10-2018 , 13:51   Re: DR script causes server to crash on slay
Reply With Quote #2

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<= MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            if(
GetClientTeam(i) == CS_TEAM_CT)
            {
                
Terrorists.Push(i);
            }
        }
    }

    
int index Terrorists.Get(GetRandomInt(0Terrorists.Length 1));
    
delete Terrorists;

    return 
index;

You can get an infinite loop with while and getrandomint.
__________________

Last edited by Ilusion9; 08-10-2018 at 17:15.
Ilusion9 is offline