AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   CVAR question (https://forums.alliedmods.net/showthread.php?t=53709)

Dark Kingdom 04-09-2007 16:20

CVAR question
 
Is it possible to set a cvar through scripting thats allready a built-in cvar?

EXAMPLE:
mp_timelimit

teame06 04-09-2007 16:29

Re: CVAR question
 
Code:
set_cvar_num("mp_timelimit", 10);

Other way is pcvar
Code:
new mp_timelimit = get_cvar_pointer("mp_timelimit"); new timelimit = get_pvar_num(mp_timelimit);

If your going to use this cvar alot I would store the pointer in an global variable and would use pcvar vs the old cvar retrieval

Dark Kingdom 04-09-2007 16:36

Re: CVAR question
 
Thanks, i'm doing a simple plugin and didn't know how :D

EDIT: Would I have to register anything if i'm JUST setting that cvar and a message?


All times are GMT -4. The time now is 06:45.

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