(Cvar Utilities) Hooking cvar question
Ok, I've tried these ways:
PHP Code:
PHP Code:
PHP Code:
|
Re: (Cvar Utilities) Hooking cvar question
You can do directly either :
Code:
or : Code:
or using CvarRegister : Code:
Now, you say it doesn't work. It doesn't help. - Show the whole code - Check the console output if you see errors - You can also check the return value of CvarHookChange |
Re: (Cvar Utilities) Hooking cvar question
But how can I use get_pcvar_num then?
|
Re: (Cvar Utilities) Hooking cvar question
With handleCvar variable from his example.
|
Re: (Cvar Utilities) Hooking cvar question
Can't I hook the change of the cvars together, but still having support for multiple cvars for sure.
|
Re: (Cvar Utilities) Hooking cvar question
You can use a same callback with different cvars, no problem.
|
Re: (Cvar Utilities) Hooking cvar question
How can I do that?
|
Re: (Cvar Utilities) Hooking cvar question
Just use CvarHookChange() for all your cvars with the cvar handle from register_cvar or CvarRegister, and write the same callback as second argument, for example "OnChange".
Like : Code:
or : Code:
or : Code:
or : Code:
Code:
Simple, isn't it ? |
Re: (Cvar Utilities) Hooking cvar question
Yes it is, I understood it before you edited. And I am using your first method.
I've got this now: PHP Code:
Quote:
PHP Code:
|
Re: (Cvar Utilities) Hooking cvar question
Bibu, please, when you have a problem :
- Give the full error - Give the full code (at least a part where we can fully understand). What is am_lightning_sound ? Where it's set ? You don't show enough code to see what you have done exactly, nor the full error to see what happens. |
| All times are GMT -4. The time now is 19:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.