Random choose
#5

Quote:
Originally Posted by DeathTone
Посмотреть сообщение
You can choose a random Iter from foreach, using:

pawn Код:
Iter_Random(Player);
will return a random id of the list of connected players.
so ...I have this command:randomgivemoney

PHP код:
#include <a_samp>
#include <ZCMD>
#include <foreach>
CMD:randomgivemoney(playerid,params[])
{
    
Iter_Random(Player);
    
GivePlayerMoney(Player,5000);
    return 
1;

It's this right?
EDIT:The other 2 guys, I said clearly: I am using Foreach.Simple loops is looping through offline players.
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: 2 Guest(s)