06.06.2011, 13:01
pawn Код:
stock SelectRandomPlayer()
{
new random = Random(MAX_PLAYERS);
if(IsPlayerConnected(random))
{
return random;
}
else
{
SelectRandomPlayer();
}
}
pawn Код:
new randomplayer = SelectRandomPlayer();
SetPlayerHealth(randomplayer, 100);
Or you can use foreach include, for more efficent random player selecting.