AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   why I cant hide this commands? (https://forums.alliedmods.net/showthread.php?t=233719)

Shockblade 01-19-2014 08:39

why I cant hide this commands?
 
hello, why this code cant hide commands, which start with "/" ?
PHP Code:

#include <amxmodx>  

#define PLUGIN "Hide Written Commands"
#define VERSION "0.0.1"

public plugin_init( ) 
{  
    
register_pluginPLUGINVERSION"Shockblade" )
        
        
register_clcmd"say timeleft""ClCmd_Standart" )
        
register_clcmd"say_team timeleft""ClCmd_Standart" )
        
register_clcmd"say currentmap""ClCmd_Standart" )
        
register_clcmd"say_team currentmap""ClCmd_Standart" )  
        
register_clcmd"say ff""ClCmd_Standart" )
        
register_clcmd"say_team ff""ClCmd_Standart" )
        
register_clcmd"say nextmap""ClCmd_Standart" )
        
register_clcmd"say_team nextmap""ClCmd_Standart" )
        
register_clcmd"say thetime""ClCmd_Standart" )
        
register_clcmd"say_team thetime""ClCmd_Standart" )
        
        
register_clcmd"say""ClCmd_All" )
        
register_clcmd"say_team""ClCmd_All" )
}  

public 
ClCmd_Standartid 
{
    return 
PLUGIN_HANDLED_MAIN
}

public 
ClCmd_Allid 

        new 
szArg[4]
        
read_argsszArgcharsmaxszArg ) )
        
remove_quotesszArg )
    
    return 
szArg[0] == '/' || szArg[0] == '' || szArg[0] == '' PLUGIN_HANDLED_MAIN PLUGIN_CONTINUE



fysiks 01-19-2014 10:36

Re: why I cant hide this commands?
 
  1. That code, as is, does not compile.
  2. When I remove "|| szArg[0] == '' || szArg[0] == ''" it compile (or put something in the single quotes).
  3. It seems that the remove_quotes() function needs to have a beginning AND and ending quote. So, the fact that you are only getting 3 characters means that you only have one quote. You can either make the string bigger to hole the whole message and remove the quotes or you can check to see if the second character it the slash character.


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

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