random ?? help
#4

Quote:
Originally Posted by Clarck
Посмотреть сообщение
Thanks Hy rep
The Code he posted will not work

Use this:

Код:
stock GetRandomOnlineID() {
    new tmp[MAX_PLAYERS],idx;
    for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) tmp[idx]=i,idx++;
    return tmp[random(idx)];
}

new id = GetRandomOnlineID(); //now you have a random id
Greekz
Reply


Messages In This Thread
random ?? help - by Clarck - 08.03.2015, 12:11
Re: random ?? help - by HY - 08.03.2015, 12:32
Re: random ?? help - by Clarck - 09.03.2015, 13:44
AW: Re: random ?? help - by Kaliber - 09.03.2015, 13:54
Re: random ?? help - by Clarck - 09.03.2015, 13:57
Re: random ?? help - by CalvinC - 09.03.2015, 14:49
Re: random ?? help - by Clarck - 09.03.2015, 16:30

Forum Jump:


Users browsing this thread: 1 Guest(s)