random? - 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? (
/showthread.php?tid=160214)
random? -
Kar - 16.07.2010
hey can i make a random like random from 4000-6000 and not random(6000) which would range from 1-6000?
Re: random? - TheInnocentOne - 16.07.2010
random(6000) would only be from 0 - 5999 by the way.
If you want to do that, use this function from ******:
pawn Код:
stock minrand(min, max) //By Alex "******" Cole
{
return random(max-min)+min;
}
Re: random? -
bigcomfycouch - 16.07.2010
pawn Код:
new rand = random(6000) + 4000;
Re: random? -
Kar - 16.07.2010
so how we use?
pawn Код:
new rand = minrand(5000-10000);
@bigcomfycouch (sorry if misspell) what would that do?
Re: random? -
zallomallo - 16.07.2010
If you wanted 4000 - 6000:
pawn Код:
new rand = minrand(4000, 6000);
Re: random? -
Kar - 16.07.2010
pawn crashed?
new randlotto = minrand(50000, 100000);
#define LOTTO_JACKPOT randlotto //How much it goes up every 30 seconds or whenever someone buys a ticket