2 Players in Iter_Random
#6

PHP код:
GetRandomPlayer()
{
    static 
Iterator:StaticList<MAX_PLAYERS>;
    if (
Iter_Size(StaticList) == 0)
    {
        foreach (new 
Player)
            
Iter_Add(i);
    }
    new 
ret Iter_Random(StaticList);
    
Iter_Remove(StaticListret);
    return 
ret;

If you are using the function for a significant amount of players at once (more than 2 or 5) plus this works for N number of players, N being number of connected players.
Reply


Messages In This Thread
2 Players in Iter_Random - by JaKe Elite - 13.12.2016, 10:05
Re: 2 Players in Iter_Random - by X337 - 13.12.2016, 10:44
Re: 2 Players in Iter_Random - by JaKe Elite - 13.12.2016, 11:05
Re: 2 Players in Iter_Random - by Konstantinos - 13.12.2016, 11:06
Re: 2 Players in Iter_Random - by JaKe Elite - 13.12.2016, 11:10
Re: 2 Players in Iter_Random - by Gammix - 13.12.2016, 12:56

Forum Jump:


Users browsing this thread: 2 Guest(s)