10.08.2011, 22:39
PHP код:
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)];
}