Raised This Month: $ Target: $400
 0% 

why I cant hide this commands?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shockblade
Member
Join Date: Dec 2012
Old 01-19-2014 , 08:39   why I cant hide this commands?
Reply With Quote #1

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

__________________
Spoiler
Shockblade is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-19-2014 , 10:36   Re: why I cant hide this commands?
Reply With Quote #2

  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.
__________________

Last edited by fysiks; 01-19-2014 at 10:37.
fysiks 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 10:09.


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