Raised This Month: $ Target: $400
 0% 

get_cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-03-2010 , 08:13   get_cvar
Reply With Quote #1

hi,

i tried anything like this :

PHP Code:
new Deleay 
    Deleay 
get_cvar_num("amx_vote_delay")
    
set_task(Float:Deleay"EndVote"
in my freeday manager because anyone wanted to have a vote function.
but my cvar ist not working. whats wrong ?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-03-2010 , 08:20   Re: get_cvar
Reply With Quote #2

get_[p]cvar_float, and use cvar pointers by the way
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-03-2010 , 08:21   Re: get_cvar
Reply With Quote #3

Quote:
Originally Posted by xPaw View Post
get_[p]cvar_float, and use cvar pointers by the way
but this exists already. do i have to register this cvar in my plugin again? i want to catch this cvar from amxx.cfg
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 02-03-2010 , 08:42   Re: get_cvar
Reply With Quote #4

Code:
new cvar_delay

public plugin_init ( )
{
    cvar_delay = get_cvar_pointer ( "amx_vote_delay" )
}

// Somewhere...
   new Float:delay = get_pcvar_float ( cvar_delay )

   set_task ( delay, "EndVote" )
}
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-03-2010 , 08:48   Re: get_cvar
Reply With Quote #5

Quote:
Originally Posted by One View Post
do i have to register this cvar in my plugin again?
-->
Quote:
Originally Posted by NiHiLaNTh View Post
Code:
new cvar_delay

public plugin_init ( )
{
    cvar_delay = get_cvar_pointer ( "amx_vote_delay" )
}

// Somewhere...
   new Float:delay = get_pcvar_float ( cvar_delay )

   set_task ( delay, "EndVote" )
}


so the answer is YES. ty anyways.ill register the cvar again
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-03-2010 , 08:54   Re: get_cvar
Reply With Quote #6

Quote:
Originally Posted by One View Post
so the answer is YES. ty anyways.ill register the cvar again
You don't re-register the cvar. Use get_cvar_pointer() for existing cvars. See NiHiLaNTh's code.
__________________
Bugsy is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-03-2010 , 09:09   Re: get_cvar
Reply With Quote #7

damn your right my bad.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 07:23.


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