14.07.2011, 19:33
pawn Code:
stock RandomID()
{
next:
new
playerid;
playerid = random(GetMaxPlayers());
if(!IsPlayerConnected(playerid))
goto next;
return playerid;
}
//or this
stock players() {
new c;
for(new i = 0; i < MAX_PLAYERS; ++i) {
if(IsPlayerConnected(i))
{
c++ ;
}
}
return c;
}
//using
//random(players())