need a little help with random
#1

i got this one..:

pawn Код:
new randpaycheck = 380 + random(680);
but how do i change the random to like.. from 380 to 680 and not 380 plus 680?...

thank you..


ohh and one more thing...

if object destroyed like if object destroyed it will recover it in 10 sec

is it possable?.. thanks again...
Reply
#2

Код:
new randpaycheck = 380 + random(680);
if(randpaycheck <= 380) randpaycheck = randpaycheck + 380;
Reply
#3

Quote:
Originally Posted by cessil
Код:
new randpaycheck = 380 + random(680);
if(randpaycheck <= 380) randpaycheck = randpaycheck + 380;
there isnt like.. mm.. new randpaycheck = random(380 - 680);

something from 1 number to the other number... (between)
Reply
#4

if you want random value between 380 and 680, this would do it: new randpaycheck = random(301)+380;
Reply
#5

ok spasibo..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)