11.01.2011, 23:22
without using foreach you could do this
pawn Код:
stock GetRandomPlayerID()
{
new op;
new po[MAX_PLAYERS];
for(new playerid;playerid<MAX_PLAYERS;playerid++)
{
if(!IsPlayerConnected(playerid))continue;
po[op]=playerid; // HAHAHHA POOP!
op++;
}
return po[random(op)];
}