Raised This Month: $ Target: $400
 0% 

difference between random_num and random_float ??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 01-27-2009 , 08:00   difference between random_num and random_float ??
Reply With Quote #1

difference between random_num and random_float ??
I want to know what is the difference.

if i have :

cvars
slap_pct 0.10
register_cvar("slap_pct", "0.05")

on this small part of my hero
if ( random_???( 0.00, 1.00 ) <= get_cvar_float("slap_pct"))
{
user_slap(victim,0)
user_slap(victim,0)
user_slap(victim,0)
}

Witch is the best ???
Thanks to help me ^^
(sorry for my bad english)

Last edited by Fr33m@n; 01-27-2009 at 08:17.
Fr33m@n is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-27-2009 , 13:53   Re: difference between random_num and random_float ??
Reply With Quote #2

Quote:
Originally Posted by Fr33m@n View Post
difference between random_num and random_float ??
I want to know what is the difference.

if i have :

cvars
slap_pct 0.10
register_cvar("slap_pct", "0.05")

on this small part of my hero
if ( random_???( 0.00, 1.00 ) <= get_cvar_float("slap_pct"))
{
user_slap(victim,0)
user_slap(victim,0)
user_slap(victim,0)
}

Witch is the best ???
Thanks to help me ^^
(sorry for my bad english)
Float = Decimal number.
Integer = Rounded number.

1 is an Integer.
1.0 is a Float.

0.00 and 1.00 are floats, therefore:
Code:
random_float(0.00, 1.00);
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 01-27-2009 , 16:37   Re: difference between random_num and random_float ??
Reply With Quote #3

:O thanks, i understand :p karma + for you ^^
Fr33m@n is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode