getrandom player function not working?
#1

pawn Код:
stock GetRandomPlayer()
{
    new ConnectedPlayers[MAX_PLAYERS];
    new idx;
    foreach(Player,i)
    {
        ConnectedPlayers[idx] = i;
        idx++;
    }
    if(idx == 0 || idx == 1) return INVALID_PLAYER_ID;
    else return ConnectedPlayers[random(idx)];
}
always returns invalid_player_id even though 5+ ppl are online?
Reply


Messages In This Thread
getrandom player function not working? - by The_Gangstas - 21.12.2010, 15:39
Re: getrandom player function not working? - by Seven. - 21.12.2010, 15:40
Re: getrandom player function not working? - by The_Gangstas - 21.12.2010, 15:45
Re: getrandom player function not working? - by Seven. - 21.12.2010, 15:48

Forum Jump:


Users browsing this thread: 1 Guest(s)