Random choose
#2

well here you go

pawn Код:
stock SelectRandomPlayer()
{
     new random = Random(MAX_PLAYERS);
     if(IsPlayerConnected(random))
     {
           return random;
     }
     else
     {
           SelectRandomPlayer();
     }
}
Now you can use it for example like this:

pawn Код:
new randomplayer = SelectRandomPlayer();
GivePlayerMoney(randomplayer, 5000);



+rep if that helps
Reply


Messages In This Thread
Random choose - by SumX - 17.09.2012, 16:20
Re: Random choose - by XtremeR - 17.09.2012, 16:31
Re: Random choose - by detter - 17.09.2012, 16:38
Re: Random choose - by DeathTone - 17.09.2012, 16:43
Re: Random choose - by SumX - 17.09.2012, 16:50
Re: Random choose - by DeathTone - 17.09.2012, 16:52
Re: Random choose - by SumX - 17.09.2012, 16:53

Forum Jump:


Users browsing this thread: 1 Guest(s)