How can i block random from giving the same value - 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: How can i block random from giving the same value (
/showthread.php?tid=513570)
How can i block random from giving the same value -
DarkLored - 17.05.2014
So how can i block the randomizer from setting the same value that another player already has?
here is the code:
pawn Код:
new banknumber = 10000 + random(15000);
Re: How can i block random from giving the same value -
Dignity - 17.05.2014
Use a loop to read all userfiles and their banknumber values. If their player variable matches bank number, add another random value ontop of the earlier value or return false.
Just an example of how you
could do it.