View Single Post
RealMessiah
New Member
Join Date: Dec 2017
Location: England
Old 08-11-2018 , 11:22   Re: DR script causes server to crash on slay
Reply With Quote #6

Quote:
Originally Posted by Ilusion9 View Post
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.
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!
__________________
There are no accidents
RealMessiah is offline