Random();
#1

Hey folks,
I'm using a varible to get an random gravity.
pawn Код:
new Float:RandomGravity=random(24)/2000+0.002;
SetGravity(RandomGravity);
Now the problem is that I always get a the same gravity (0.002).
That means the random function has always the value 0.
What's wrong?
Reply
#2

Always divide by a float.
Reply
#3

Quote:
Originally Posted by 0rb
Always divide by a float.
pawn Код:
new Float:RandomGravity=random(24)/2000.000+0.002;
SetGravity(RandomGravity);
Thank you, it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)