Raised This Month: $51 Target: $400
 12% 

Solved [ H3LP ] Check CVAR


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-20-2017 , 05:43   [ H3LP ] Check CVAR
Reply With Quote #1

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 !

Last edited by DarthMan; 06-20-2017 at 09:11. Reason: Solved
DarthMan is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-20-2017 , 06:51   Re: [ H3LP ] Check CVAR
Reply With Quote #2

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.
__________________

Last edited by HamletEagle; 06-20-2017 at 06:53.
HamletEagle is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-20-2017 , 08:58   Re: [ H3LP ] Check CVAR
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
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 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 06-20-2017 , 09:11   Re: [ H3LP ] Check CVAR
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
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
DarthMan is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:49.


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