Quote:
Originally Posted by Backwardsman97
The way I did this, like if you had to pick a random player id, was to store all of the possible choices in an array and then pick randomly from the array size. Maybe like this.
pawn Код:
new playerlist[MAX_PLAYERS], size; // Maybe this is uneccessary and you could use sizeof
for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { playerlist[size] = i; size++; } }
new rand = playerlist[random(size) + 1];
Something like that I think.
Edit : Too slow...
|
Thanks for trying but doesn't really seem like what I want..