Raised This Month: $ Target: $400
 0% 

Solved Hiding commands in public chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asw32
Junior Member
Join Date: Apr 2017
Old 04-12-2017 , 19:09   Re: Hiding commands in public chat
Reply With Quote #1

Quote:
Originally Posted by LegacyCode View Post
Try this:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin"ChatCmdBlocker""0.1""LegacyCode" )

    
register_clcmd"say""handleBlockCmdOutput" )
    
register_clcmd"say_team""handleBlockCmdOutput" )
}

public 
handleBlockCmdOutputid )
{
    new const 
a_ChatCommands[][] =
    {
        
"thetime",
        
"/rank",
        
"/top15",
        
"/hp",
        
"/nextmap",
        
"/timeleft"
    
}

    new 
s_Message[192], s_ChatCmd[16]
    
read_argss_Messagecharsmaxs_Message ) )
    
remove_quotess_Message )
    
trims_Message )

    if ( !
s_Message[0] || !is_user_connectedid ) )
        return 
PLUGIN_HANDLED

    copyc
s_ChatCmdcharsmaxs_ChatCmd ), s_Message' ' )

    for ( new 
isizeof a_ChatCommandsi++ )
    {
        if ( 
equalis_ChatCmda_ChatCommands[i] ) )
            return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_CONTINUE

Place it at the very start of the "Custom" section in plugins.ini:

Code:
; Custom - Add 3rd party plugins here
block_chat.amxx
...
I hope this is a good attempt at the problem, I'm new to this.
Let me know if it works!

- LegacyCode
Thanks so much for your effort. And thank you to the other poster as well.

Using yours, Legacy, it works in that it doesn't display the command being said. But for example, when someone types "thetime", it still displays the time to everyone in the server. I want it to only show up to the person who typed it. How would that be done? Also, instead of "/nextmap" and "/timeleft" I need it to work for "nextmap" and "timeleft" instead.
asw32 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 17:57.


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