Random pay - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random pay (
/showthread.php?tid=145226)
Random pay -
ArTisT - 01.05.2010
Hey all !
I'm having a mini mission system I want it should give money random between example 1000 - 5000
Now im using
Quote:
new money = random(2500);
|
Re: Random pay -
Deji - 01.05.2010
Код:
new money = random(4000); // maximum amount - minimum amount
money = money + 1000; // minimum amount
Re: Random pay -
ArTisT - 01.05.2010
Quote:
Originally Posted by Deji
Код:
new money = random(4000); // maximum amount - minimum amount
money = money + 1000; // minimum amount
|
So this pays between 4000 and 1000 or ?
Re: Random pay -
Nero_3D - 01.05.2010
Quote:
Originally Posted by ArTisT
Quote:
Originally Posted by Deji
Код:
new money = random(4000); // maximum amount - minimum amount
money = money + 1000; // minimum amount
|
So this pays between 4000 and 1000 or ?
|
no, from 1000 till 4999
pawn Код:
/* credits to ******. */
stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
so you only need to do
pawn Код:
new number = randomEx(1000, 4000);