Raised This Month: $ Target: $400
 0% 

return a client cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
the1991
Junior Member
Join Date: Aug 2006
Old 07-30-2008 , 20:28   return a client cvar
Reply With Quote #1

so i was looking at fullupdate_blocker and what the plugin does is binds over the fullupdate command with a new function so that a player cannot use fullupdate.
Code:
register_clcmd("fullupdate","fullupdate")
if i wanted to make it so that i could restore normal use of fullupdate, what command would i use to "rebind" it to the regular client cvar.
the1991 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 07-31-2008 , 13:55   Re: return a client cvar
Reply With Quote #2

Well if that command is registered like that, you couldn't restore it. Because the command would always be "fullupdate".
You can just make a CVar that can disable/enable the use of it.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
the1991
Junior Member
Join Date: Aug 2006
Old 07-31-2008 , 19:47   Re: return a client cvar
Reply With Quote #3

that would be a good alternative, but how does one disable a cvar? i guess you can catch the command with client_command, but then how do you keep the command from being executed? sorry if i'm ignorant...i'm only just learning these modules.

Last edited by the1991; 07-31-2008 at 19:49.
the1991 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 07-31-2008 , 20:30   Re: return a client cvar
Reply With Quote #4

Code:
#include <amxmodx> new p_Enable public plugin_int() {     register_plugin("Block Fullupdate","0.1a","Drak");     p_Enable = register_cvar("amx_blockfullupdate","1"); } public client_command(id) {     if(get_pcvar_num(p_Enable))     {         new Command[33]         read_argv(0,Command,32);         if(equal(Command,"fullupdate"))             return PLUGIN_HANDLED_MAIN     } }

This should work, not sure. But "amx_blockfullupdate 1/0" will enable disable the usage of it.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
the1991
Junior Member
Join Date: Aug 2006
Old 08-01-2008 , 15:21   Re: return a client cvar
Reply With Quote #5

well done sir! that's a very useful bit of code to me. a quick question about client_command. what exactly triggers it. for instance, does any client cvar change go to that function. does something like a weapon drop?
the1991 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 08-01-2008 , 16:57   Re: return a client cvar
Reply With Quote #6

Quote:
Originally Posted by the1991 View Post
well done sir! that's a very useful bit of code to me. a quick question about client_command. what exactly triggers it. for instance, does any client cvar change go to that function. does something like a weapon drop?
Only commands trigger it. Client-Side CVars will not trigger that function.
And because weapon drop ("drop") is a command, that would trigger it.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
hasta
Senior Member
Join Date: Aug 2004
Location: Ukraine, Kyiv
Old 01-19-2009 , 09:29   Re: return a client cvar
Reply With Quote #7

error when compil
Quote:
home/groups/amxmodx/tmp3/textjnGOie.sma(20) : warning 209: function "client_command" should return a value
how ti fix?
hasta is offline
Send a message via ICQ to hasta
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-19-2009 , 12:23   Re: return a client cvar
Reply With Quote #8

Code:
#include <amxmodx> new p_Enable public plugin_int() {     register_plugin("Block Fullupdate","0.1a","Drak");     p_Enable = register_cvar("amx_blockfullupdate","1"); } public client_command(id) {     if(get_pcvar_num(p_Enable))     {         new Command[33]         read_argv(0,Command,32);         if(equal(Command,"fullupdate"))             return PLUGIN_HANDLED_MAIN     }     return PLUGIN_CONTINUE }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dRk13
New Member
Join Date: Aug 2008
Location: Bucharest
Old 05-26-2009 , 12:53   Re: return a client cvar
Reply With Quote #9

and if i want to make the same with cl_pitchspeed? can I?
dRk13 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-26-2009 , 16:12   Re: return a client cvar
Reply With Quote #10

cl_pitchspeed is a cvar, so it cannot be detected as a command.
You will need to use a cvar enforcing plugin.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 05:29.


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