AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reading the value of a cvar (https://forums.alliedmods.net/showthread.php?t=162540)

Diegorkable 07-20-2011 06:40

Reading the value of a cvar
 
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)

deadman909 07-20-2011 06:46

Re: Reading the value of a cvar
 
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"

Bugsy 07-20-2011 07:26

Re: Reading the value of a cvar
 
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 ); 


Diegorkable 07-20-2011 07:40

Re: Reading the value of a cvar
 
Quote:

Originally Posted by deadman909 (Post 1514461)
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!


All times are GMT -4. The time now is 00:58.

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