Raised This Month: $ Target: $400
 0% 

Block a "say /cmd" unless cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-09-2011 , 02:45   Block a "say /cmd" unless cvar
Reply With Quote #1

How would i block the command say /cmd with a cvar?

Let's say i have a cvar amx_sayblock 1

if people say /cmd it doesnt do anything else if amx_sayblock 0

/cmd works
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
reinert
Veteran Member
Join Date: Feb 2007
Old 04-09-2011 , 02:51   Re: Block a "say /cmd" unless cvar
Reply With Quote #2

PHP Code:
register_clcmd("say /cmd""cmdCmd")
register_cvar("amx_sayblock""0")

public 
cmdCmd(id)
{
   if( 
get_cvar_num("amx_sayblock") == 0)
        return 
PLUGIN_HANDLED;

   
// else if sayblock is 1

reinert is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-09-2011 , 02:56   Re: Block a "say /cmd" unless cvar
Reply With Quote #3

thanks figured that after the post xD
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
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 13:48.


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