Random Numbers
#1

Hello there, i've been tring to set a random number between 17 and 19 but its not working, it always comes out as 18.

Heres what i use for rand:

pawn Код:
//random(max- min) + min;
new rand = random(19 - 17) + 17;
Any help will be appriciated
Reply
#2

pawn Код:
stock minrand(min, max) //By Alex "******" Cole
{
    return random(max - min) + min;
}
pawn Код:
new rand = minrand(17, 19);
Reply
#3

Thanks
Reply
#4

Very Faster:
PHP код:
#define minrand(%0, %1) random(%1- %0) + %0 //By Alex "******" Cole 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)