AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Question ammount (https://forums.alliedmods.net/showthread.php?t=95430)

MagNeto 06-23-2009 14:16

Question ammount
 
ammount [ set_user_rendering( ) ] is a float cvar, or ?

Arkshine 06-23-2009 14:30

Re: Question ammount
 
What do you mean ?

MagNeto 06-23-2009 14:42

Re: Question ammount
 
Code:

#include <amxmodx>
#include <fun>

new ammount;


public plugin_init( )
{
    ammount = register_cvar( "render_ammount", "120" )
}
public blabla( id,level,cid )
...
    set_user_rendering( id,kRenderFxGlowShell,color0,color1,color2,kRenderNormal,get_pcvar_float( ammount ) );

?

TitANious 06-23-2009 17:36

Re: Question ammount
 
Should work :)

tpt 06-23-2009 19:32

Re: Question ammount
 
Quote:

Originally Posted by TitANious (Post 855360)
Should work :)

It won't work because he is trying to get integer value with get_pcvar_float. So use get_pcvar_num instead. ;-)

SnoW 06-24-2009 05:07

Re: Question ammount
 
Quote:

Originally Posted by tpt (Post 855443)
It won't work because he is trying to get integer value with get_pcvar_float.

Actually that's not true. It gets the value from the cvar properly, but the native requires an integer value, so get_pcvar_num should be used.

xPaw 06-24-2009 05:29

Re: Question ammount
 
Read his post again
Quote:

Originally Posted by tpt (Post 855443)
It won't work because he is trying to get integer value with get_pcvar_float. So use get_pcvar_num instead. ;-)


SnoW 06-24-2009 06:37

Re: Question ammount
 
Quote:

Originally Posted by xPaw (Post 855700)
Read his post again

Maybe you'll read my post again. Or read this:
Quote:

Originally Posted by tpt (Post 855443)
It won't work because he is trying to get integer value with get_pcvar_float.

He said it wouldn't work because the cvar's value is integer and he's using get_pcvar_float. And that's not the reason why the plugin isn't working. It returns the value as float properly and after that the error happens when the native set_user_rendering gets the float instead of an integer value. There's nothing wrong using get_pcvar_float even the cvar value is integer, cause it works as good as if the cvar would be "120.0".

MagNeto 06-24-2009 07:01

Re: Question ammount
 
get_pcvar_num or float ? :|
Someone said num, someone said float.
Well ?

Arkshine 06-24-2009 07:07

Re: Question ammount
 
set_user_rendering requires an integer, so use get_pcvar_num.


All times are GMT -4. The time now is 15:34.

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