AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] Check CVAR (https://forums.alliedmods.net/showthread.php?t=298678)

DarthMan 06-20-2017 05:43

[ H3LP ] Check CVAR
 
Hey. Is there a way to execute something on cvar change without using a task that always checks the value? So, for example, when I set the max_checkpoint cvar to 0, if it was 1, I want to play a sound and same if it was 0 and I set it to 1, but not if the new value equals the old value, like if it was 1 and now ti is 1 as well. I know how to do it using a global var and cvar value check on a task, but I wouldn't want to use a task that repeats every second just for that. So, any way to do it using the default inc files? Thanks !

HamletEagle 06-20-2017 06:51

Re: [ H3LP ] Check CVAR
 
If you use amxx 1.8.3, yes. If not, you need to use orpheu, but since you know how to use it, this should not be an issue. If you want to see how, check my Grenade Manager for Cvar_DirectSet.

DarthMan 06-20-2017 08:58

Re: [ H3LP ] Check CVAR
 
Quote:

Originally Posted by HamletEagle (Post 2530033)
If you use amxx 1.8.3, yes. If not, you need to use orpheu, but since you know how to use it, this should not be an issue. If you want to see how, check my Grenade Manager for Cvar_DirectSet.

I am using amxx 1.8.3 btw :)

DarthMan 06-20-2017 09:11

Re: [ H3LP ] Check CVAR
 
Quote:

Originally Posted by HamletEagle (Post 2530033)
If you use amxx 1.8.3, yes. If not, you need to use orpheu, but since you know how to use it, this should not be an issue. If you want to see how, check my Grenade Manager for Cvar_DirectSet.

Worked with orpheu, ty so much :D


All times are GMT -4. The time now is 22:50.

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