19.07.2011, 21:03
This works perfectly:
How to Use:
Credits: rjjj
pawn Код:
stock randomplayer()
{
new z = 0, w, y = GetMaxPlayers();
static Conectados[MAX_PLAYERS];
while(z < y)
{
if(IsPlayerConnected(z))
{
Conectados[w] = z;
w++;
}
z++;
}
return !w ? -1 : Conectados[random(w)];
}
pawn Код:
printf("Random ID: %d", randomplayer());