Page 1 of 1

Rand function question

PostPosted: Tue Aug 07, 2007 9:45 pm
by jimmynewguy
How do i make it where if i wanted to add a random number for it to be whole? I want a random amount of ammo 2 b picked up and i always get decimals, is there any way to do this? Plz help. THX :D

PostPosted: Tue Aug 07, 2007 10:38 pm
by makslane
Use the round function:

Code: Select all
yourvariable = round(rand(maxvalue));

PostPosted: Wed Aug 08, 2007 2:28 am
by pixelpoop
You probably figured this out but I think makslane meant "round" not "raound".

PostPosted: Wed Aug 08, 2007 2:30 am
by makslane
Thanks!