SA-MP Forums Archive
Random Negative 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 Negative Money (/showthread.php?tid=321559)



Random Negative Money - ryan39 - 27.02.2012

Hi I have a command which I want to give minus 1000 to minus 5500 dollars. I have tried copying normal random money for positive scripts but it just ends up giving me like 99999999999 dollars. I don't understand why negative money doesn't work.

Anyone?


Re: Random Negative Money - Babul - 27.02.2012

its because the random function returns 0 to n-1 as random amount, it takes positive integers only. to care for the negativity, is your job:
pawn Код:
new takeaway=-(1000+random(4500));
watch the simple - char infront of the formula


Re: Random Negative Money - ryan39 - 27.02.2012

Thank you!

I understand!