16.02.2012, 11:32
You could create a function, or use Iter_Random (I think It's that) in ******' foreach, if you're using foreach, that is.
Here is a function that will get you a random, connected, player - though it could be done much better!
Here is a function that will get you a random, connected, player - though it could be done much better!
pawn Code:
stock RandomPlayer()
{
new iPlayer = random(GetMaxPlayers());
while(!IsPlayerConnected(iPlayer)) iPlayer = random(GetMaxPlayers());
return iPlayer;
}