08.02.2017, 16:12
It's possible without foreach, however is less optimized. This might work, I haven't tested it though.
This continues the code block until a random player has been selected.
pawn Код:
new RandomPlayer = INVALID_PLAYER_ID, TempIndex;
while(RandomPlayer == INVALID_PLAYER_ID)
{
TempIndex = random(GetPlayerPoolSize() + 1);
if(TempIndex != INVALID_PLAYER_ID)
RandomPlayer = TempIndex;
}