Raised This Month: $ Target: $400
 0% 

Reading the value of a cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 06:40   Reading the value of a cvar
Reply With Quote #1

How can I get the value of a cvar? for example, how can i store in a variable the value of mp_timelimit? (i dont remember if there's an actual cvar of mp_timelimit but you get my point)
Diegorkable is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 07-20-2011 , 06:46   Re: Reading the value of a cvar
Reply With Quote #2

you mean how to you read what cvars are set to?
If yes than you must have admin with access to cvar. (The g flag)

If you have access to it than just type in console
amx_cvar mp_timelimit

or
amx_cvar "CvarNameYouWishToView"
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-20-2011 , 07:26   Re: Reading the value of a cvar
Reply With Quote #3

Existing cvar value that you will need to read only once:
PHP Code:
iValue get_cvar_num"mp_timelimit" ); 
Existing cvar value that you may need to read multiple times:
PHP Code:
//Read this only once
pCVar get_cvar_pointer"mp_timelimit" );

iValue get_pcvar_numpCVar ); 
__________________

Last edited by Bugsy; 07-20-2011 at 08:01.
Bugsy is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 07:40   Re: Reading the value of a cvar
Reply With Quote #4

Quote:
Originally Posted by deadman909 View Post
you mean how to you read what cvars are set to?
If yes than you must have admin with access to cvar. (The g flag)

If you have access to it than just type in console
amx_cvar mp_timelimit

or
amx_cvar "CvarNameYouWishToView"
Rofl I meant in scripting, but the one below you helped me so its cool.

To the one who helped me - thanks!
Diegorkable 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 00:58.


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