Raised This Month: $ Target: $400
 0% 

Setting Cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigMac
Member
Join Date: Jul 2009
Old 08-21-2009 , 18:58   Setting Cvars
Reply With Quote #1

How would i make Cvars for this??


<hamsandwich>


set_task(get_cvar_float("BCM_timelockrtt" ), "unlockVoteConfig");
new type = get_cvar_num("BCM_automaticloading");
new roundLimit = get_cvar_num("BCM_loadingrounds");
__________________
BigMac is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-21-2009 , 19:02   Re: Setting Cvars
Reply With Quote #2

if(get_pcvar_num(type)) {
}

if(get_pcvar_num(roundlimit)) {
}
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-21-2009 , 19:44   Re: Setting Cvars
Reply With Quote #3

PHP Code:
register_cvar("my_cvar_here""default value"

Quote:
Originally Posted by crazyeffect View Post
if(get_pcvar_num(type)) {
}

if(get_pcvar_num(roundlimit)) {
}
They aren't pcvars.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-21-2009 , 19:52   Re: Setting Cvars
Reply With Quote #4

Just be sure to use the correct type:

PHP Code:
//register cvars, setting cvar pointers to variables for use later
new g_pInterval register_cvar"BCM_timelockrtt" "1.5" );
new 
g_pType register_cvar"BCM_automaticloading" "1" );

//access timelockrtt value (float\decimal)
get_pcvar_floatg_pInterval );

//access automaticloading value (integer)
get_pcvar_numg_pType );

//Likewise, use the respective set_pcvar_* to change the value
set_pcvar_floatg_pInterval 1.5 );
set_pcvar_numg_pType ); 
__________________

Last edited by Bugsy; 08-21-2009 at 19:56.
Bugsy is offline
BigMac
Member
Join Date: Jul 2009
Old 08-21-2009 , 20:46   Re: Setting Cvars
Reply With Quote #5

Thanks for the help +karma
__________________
BigMac 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:15.


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