AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block a "say /cmd" unless cvar (https://forums.alliedmods.net/showthread.php?t=154467)

Battousai-sama 04-09-2011 02:45

Block a "say /cmd" unless cvar
 
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

reinert 04-09-2011 02:51

Re: Block a "say /cmd" unless cvar
 
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



Battousai-sama 04-09-2011 02:56

Re: Block a "say /cmd" unless cvar
 
thanks figured that after the post xD


All times are GMT -4. The time now is 20:09.

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