SA-MP Forums Archive
Random Function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Random Function (/showthread.php?tid=502715)



Random Function - Yochui - 25.03.2014

Hello Samp'ers, I have a question:

Is it possible to use "random" function to pick a random public? Example: Player goes to a point, he uses /getgift command and he can receive one of those: a car(i have my own dealership, no problem with this), clear warns, clear faction punish or a random amount of money.

I don't want the whole code, I just want to know if it possible to do like so, if yes, how?


Re: Random Function - park4bmx - 25.03.2014

of course.
you can make a random number being chosen from 1 to 5.
Then have the callback set up if for example number 3 hits a certain callback calls


Re: Random Function - Yochui - 25.03.2014

Quote:
Originally Posted by park4bmx
Посмотреть сообщение
of course.
you can make a random number being chosen from 1 to 5.
Then have the callback set up if for example number 3 hits a certain callback calls
Thanks, I have created what I've wanted.
+ rep