Quote:
Originally Posted by LegacyCode
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 handleBlockCmdOutput( id )
{
new const a_ChatCommands[][] =
{
"thetime",
"/rank",
"/top15",
"/hp",
"/nextmap",
"/timeleft"
}
new s_Message[192], s_ChatCmd[16]
read_args( s_Message, charsmax( s_Message ) )
remove_quotes( s_Message )
trim( s_Message )
if ( !s_Message[0] || !is_user_connected( id ) )
return PLUGIN_HANDLED
copyc( s_ChatCmd, charsmax( s_ChatCmd ), s_Message, ' ' )
for ( new i; i < sizeof a_ChatCommands; i++ )
{
if ( equali( s_ChatCmd, a_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.