SA-MP Forums Archive
Random percent reward command - 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 percent reward command (/showthread.php?tid=552604)



Random percent reward command - pedrotvr - 25.12.2014

I wanted a basic command, for me to do something else that employee as follows:
The player / random, and have these chances of winning:
/*
0.10% = 1.000.000.000
1.90% = 50.000.000
3% = 500
5% = 25.000.000
10% = 100.000
15% = 50.000
25% = 60.000
40% = 30.000
total: 100%, random percents
*/


AW: Random percent reward command - Flori - 25.12.2014

Use the "random" code.
Like: example:

random(100);

0-40 gives 30000
41-65 gives 60000
66-80 gives 50000
...