21.12.2010, 15:39
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)];
}