Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
I need random number from 0 to 9 i use that
random(10) but i don't want numbers 1,8,7 how to drop them?
Posts: 1,266
Threads: 6
Joined: Oct 2014
you can simple use while loop here is a example below
PHP код:
new myvalue = random(10);
while(myvalue == 1 || myvalue == 8 || myvalue == 7)
{
myvalue = random(10);
}
you can read more about while on this page
https://sampwiki.blast.hk/wiki/While#while
Posts: 1,208
Threads: 36
Joined: Apr 2015
PHP код:
new array[] = {0,2,3,4,5,6,9};
new myvalue = array[random(sizeof(array))]