Random Money - 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 Money (
/showthread.php?tid=472066)
Random Money -
Sewayne - 26.10.2013
I am creating cops and robbers server.
And I want players to rob random money between 0 - 6000 from a store, how would I use the random function to do this?
Re: Random Money -
MrTinder - 26.10.2013
Code:
new jCash = random(6000);
GivePlayerMoney(playerid, jCash);
Re: Random Money -
arakuta - 26.10.2013
Random returns a value between 0, and it parŠ²meter, called max.
For example, to get a value between 0 and 6000, just use
Read more here:
https://sampwiki.blast.hk/wiki/Random
Re: Random Money -
Konstantinos - 26.10.2013
6001 is 0-6000
6000 is 0-5999
Therebefore:
pawn Code:
GivePlayerMoney(playerid, random(6001));
Re: Random Money -
Hamam - 26.10.2013
Use this site.
https://sampwiki.blast.hk/wiki/Random
Re: Random Money -
Sewayne - 26.10.2013
Thanks for your help guys