AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Random_float in float (https://forums.alliedmods.net/showthread.php?t=183836)

Rirre 04-27-2012 11:11

Random_float in float
 
Code:
entity_set_vector(id, EV_VEC_punchangle, Float:{random_float(-35.0, 35.0), random_float(-90.0, 90.0), 0.0});
Code:

error 008: must be a constant expression; assumed zero
How can I use random_float() in Float:?

<VeCo> 04-27-2012 11:13

Re: Random_float in float
 
That is a vector, you should make a new array variable and set random_float to each of it's slots.

Something like this:

PHP Code:

new Float:angles[3]
 
angles[0] = random_float(...)
angles[1] = random_float(...)
angles[2] = random_float(...) 


Rirre 04-27-2012 11:18

Re: Random_float in float
 
It works, thank you.


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

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