Raised This Month: $ Target: $400
 0% 

register_event("cvar change")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-28-2006 , 20:11   register_event("cvar change")
Reply With Quote #1

Is there a way to have an event triggered when a specific cvar is changed? Even if I can have a trigger if any cvar changes and then check the ones I want that would work for me also. Sorry I'm a little rusty. Haven't coded in about 2 year.. but it's coming back.

Sui
__________________
Code:
#include <amxmodx> public client_connect(id){   new playerIQ    get_player_IQ(id,playerIQ)   if(playerIQ < 100 )  {     client_cmd(id,"say I'm too stupid to play;quit")  }   PLUGIN_CONTINUE}
KiN | SuicideDog is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 07-28-2006 , 20:36   Re: register_event("cvar change")
Reply With Quote #2

The most precise way is probably to hook server_frame and check if a stored global value is the same as the current value.

Kinda messy but there is no real event for it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-29-2006 , 23:03   Re: register_event("cvar change")
Reply With Quote #3

I hate hooking the server frame.. it's nasty.. don't don't even like using a server task at 1.0 sec interval.. any other suggestions?
__________________
Code:
#include <amxmodx> public client_connect(id){   new playerIQ    get_player_IQ(id,playerIQ)   if(playerIQ < 100 )  {     client_cmd(id,"say I'm too stupid to play;quit")  }   PLUGIN_CONTINUE}
KiN | SuicideDog is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 07-29-2006 , 23:53   Re: register_event("cvar change")
Reply With Quote #4

Did you try making it a command?

I've seen plugins (with custom cvars) use this way to detect a cvar change.
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-30-2006 , 01:13   Re: register_event("cvar change")
Reply With Quote #5

Make it a command? What do you mean? Please explain
__________________
Code:
#include <amxmodx> public client_connect(id){   new playerIQ    get_player_IQ(id,playerIQ)   if(playerIQ < 100 )  {     client_cmd(id,"say I'm too stupid to play;quit")  }   PLUGIN_CONTINUE}
KiN | SuicideDog is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 07-30-2006 , 09:08   Re: register_event("cvar change")
Reply With Quote #6

See the Real Nade Drop source and you'll see what does he meant.
VEN 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 19:34.


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