05.08.2007, 16:19
This gets a randomly selected connected ID. If none is connected, then in theory, it'll keep trying until someone does.
Example of use:
pawn Код:
stock GetRandomID()
{
new randn = random(MAX_PLAYERS);
if(IsPlayerConnected(randn)) return randn;
else
{
return GetRandomID();
}
}
pawn Код:
GivePlayerMoney(GetRandomID(), 5000);