random
#1

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?
Reply
#2

you can simple use while loop here is a example below
PHP код:
new myvalue random(10);
while(
myvalue == || myvalue == || myvalue == 7)
{
    
myvalue random(10);

you can read more about while on this page https://sampwiki.blast.hk/wiki/While#while
Reply
#3

PHP код:
new array[] = {0,2,3,4,5,6,9};

new 
myvalue = array[random(sizeof(array))] 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)