new rand;while((rand = random(GetPlayerPoolSize() + 1)) && IsPlayerConnected(rand)) { // rand es igual una ID random conectada.}
stock obtenerIDrandom() { new a = 0, b[MAX_PLAYERS]; for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { if(!IsPlayerConnected(playerid)) continue; b[a++] = playerid; } if(a) return b[random(a)]; return INVALID_PLAYER_ID; }