SA-MP Forums Archive
generate 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)
+--- Thread: generate random (/showthread.php?tid=632493)



generate random - Bussyman - 15.04.2017

Hi,

I want generate random, but not include some numbers, i'am thinking using while, but it's possible that there never can by random so this can harm server.. I do random(50)


Re: generate random - Freaksken - 15.04.2017

Generate a random number, check if it is a number you want to exclude, if it is, generate another random number, check again, and so on ... A while is indeed what you should use.