Raised This Month: $ Target: $400
 0% 

Question ammount


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MagNeto
Member
Join Date: May 2009
Old 06-23-2009 , 14:16   Question ammount
Reply With Quote #1

ammount [ set_user_rendering( ) ] is a float cvar, or ?
MagNeto is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-23-2009 , 14:30   Re: Question ammount
Reply With Quote #2

What do you mean ?
__________________
Arkshine is offline
MagNeto
Member
Join Date: May 2009
Old 06-23-2009 , 14:42   Re: Question ammount
Reply With Quote #3

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 ) );
?
MagNeto is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-23-2009 , 17:36   Re: Question ammount
Reply With Quote #4

Should work
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
tpt
Member
Join Date: Jun 2009
Location: Scripting help section
Old 06-23-2009 , 19:32   Re: Question ammount
Reply With Quote #5

Quote:
Originally Posted by TitANious View Post
Should work
It won't work because he is trying to get integer value with get_pcvar_float. So use get_pcvar_num instead. ;-)
tpt is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 06-24-2009 , 05:07   Re: Question ammount
Reply With Quote #6

Quote:
Originally Posted by tpt View Post
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.
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2009 , 05:29   Re: Question ammount
Reply With Quote #7

Read his post again
Quote:
Originally Posted by tpt View Post
It won't work because he is trying to get integer value with get_pcvar_float. So use get_pcvar_num instead. ;-)
__________________
xPaw is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 06-24-2009 , 06:37   Re: Question ammount
Reply With Quote #8

Quote:
Originally Posted by xPaw View Post
Read his post again
Maybe you'll read my post again. Or read this:
Quote:
Originally Posted by tpt View Post
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".

Last edited by SnoW; 06-24-2009 at 06:39.
SnoW is offline
Send a message via MSN to SnoW
MagNeto
Member
Join Date: May 2009
Old 06-24-2009 , 07:01   Re: Question ammount
Reply With Quote #9

get_pcvar_num or float ?
Someone said num, someone said float.
Well ?
MagNeto is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-24-2009 , 07:07   Re: Question ammount
Reply With Quote #10

set_user_rendering requires an integer, so use get_pcvar_num.
__________________
Arkshine 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 15:34.


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