AlliedModders

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

ish12321 05-25-2018 15:52

hook_cvar_change
 
hello,
I'm hooking cvar_change with hook_cvar_change(). In callback,however, the new value of the cvar is not coming correct.

fysiks 05-25-2018 23:48

Re: hook_cvar_change
 
Ok. Thanks for the info.

HamletEagle 05-25-2018 23:52

Re: hook_cvar_change
 
Quote:

Originally Posted by fysiks (Post 2593889)
Ok. Thanks for the info.

Made my day.

@OP, care to provide some test code?

ish12321 05-26-2018 05:11

Re: hook_cvar_change
 
Code:
hook_cvar_change(cvar_pcvar, "function"); public function(pcvar, old, newval) {     client_print(0, print_chat, "%d %d", old, newval); }

Sorry for not providing earlier. The value printed in chat is not the cvar value (old and new both are diff). Am I doing something wrong?

CrAzY MaN 05-26-2018 08:45

Re: hook_cvar_change
 
Instead of "new", use something else!

ish12321 05-26-2018 09:00

Re: hook_cvar_change
 
Quote:

Originally Posted by CrAzY MaN (Post 2593940)
Instead of "new", use something else!

That was just a test code made in hurry. In original, something else is used.


All times are GMT -4. The time now is 04:37.

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