AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [how to] hook client settings commands (https://forums.alliedmods.net/showthread.php?t=102811)

ehha 09-06-2009 08:30

[how to] hook client settings commands
 
I would like to "grab" the moment when a client types developer, for example, in console, also with a argument. I've tried this:
Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_clcmd("developer", "check_dev"); } public check_dev(id) {     client_print(0, print_chat, "Hooked!");     read_argv(1, arg, 32) }
Failed.
I know about query_client_cvar & how to use it but this requires a repetitive task to check it constantly.
Thank you.

Bugsy 09-06-2009 08:33

Re: [how to] hook client settings commands
 
It is a cvar so you will need to use query_client_cvar().

ehha 09-06-2009 08:48

Re: [how to] hook client settings commands
 
So no matter what clcmd I register it won't work if it's already a client cvar?

Bugsy 09-06-2009 11:00

Re: [how to] hook client settings commands
 
developer is a cvar not a client command; there's no way to hook it with register_clcmd.


All times are GMT -4. The time now is 10:16.

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