Raised This Month: $51 Target: $400
 12% 

Hide slash messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 03-18-2018 , 23:20   Hide slash messages
Reply With Quote #1

Well hello,

I'm looking for a plugin which hides any message starting with slash " / "
So far I've tried every plugin thats available on internet, none of them worked, also tried to put it at the top, then at the bottom in plugins.ini, tried PLUGIN_HANDLED_MAIN, everything.
It sometimes simply blocks the whole message.

Is there any optimised version which could work under 1.8.2 no matter what kind of chat replacement plugins you're using?
__________________

Last edited by SomewhereLost; 03-18-2018 at 23:20.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
CookieCrumbler
Senior Member
Join Date: Feb 2013
Location: Australia
Old 03-18-2018 , 23:37   Re: Hide slash messages
Reply With Quote #2

Hardcode return PLUGIN_HANDLED into your plugin

eg:

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /saysomething""some_command"ADMIN_BAN);
}


public 
some_command()
{
    if ( 
whatever == something 
    {
        
server_cmd("say Printing some message from using /saysomething say command")
    
        return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_CONTINUE;   

or use

PHP Code:
#include < amxmodx >

public plugin_init( ) 
{
    
register_plugin"Hide Slash Commands""1.0.0""Kreation" );
    
register_clcmd"say""CmdSay" );
    
register_clcmd"say_team""CmdSay" );
}

public 
CmdSayid )
{
    new 
szArg[4];
    
read_argsszArgcharsmaxszArg ) );
    
remove_quotesszArg );

    return 
szArg[0] == '/' PLUGIN_HANDLED_MAIN PLUGIN_CONTINUE;

__________________
--------------------------------------------------
C is for cookie ... thats good enuff 4 me

Last edited by CookieCrumbler; 03-19-2018 at 01:14.
CookieCrumbler is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 03-19-2018 , 00:05   Re: Hide slash messages
Reply With Quote #3

Wat? Thats completely different thing.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
CookieCrumbler
Senior Member
Join Date: Feb 2013
Location: Australia
Old 03-19-2018 , 00:33   Re: Hide slash messages
Reply With Quote #4

Please explain better what you mean.
In one line you say:
"I'm looking for a plugin which hides any message starting with slash " / " "
and then you said
"tried PLUGIN_HANDLED_MAIN, everything. It sometimes simply blocks the whole message."

To me that doesn't make sense because your saying you want to hide the message but then your saying it blocks the message.

Elaborate on what your trying to acheive

Do you mean if somebody types /example in chat , like an admin or player , you want it so that /example does not appear. If so using the above code is what you need. It blocks the /example from being displayed in chat but will still print the message "Printing some message from using /saysomething say command" or execute some function from that command without displaying /example to everyone in the chat.

Or do you mean that messages that are printed to the client from a plugin that start with / you want to remove the /

Or do you mean that messages that are printed to the client from a plugin that start with / you want to remove the entire message.

Or do you mean if somebody types something in chat and / is at the start of the message you want to remove the / but still display the text that is after the /

Elaborate more please and post the code wrapped in php tags
__________________
--------------------------------------------------
C is for cookie ... thats good enuff 4 me

Last edited by CookieCrumbler; 03-19-2018 at 00:38.
CookieCrumbler is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-19-2018 , 02:10   Re: Hide slash messages
Reply With Quote #5

Read the first arguement or da whole. Check if arg[0] is "/" and handle.
__________________
Relaxing is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 03-19-2018 , 02:53   Re: Hide slash messages
Reply With Quote #6

Quote:
Originally Posted by CookieCrumbler View Post
-snip-
I'm thinking he wants a plugin that performs the task that the "SilentFailSuppress" option in Sourcemod performs.

Basically this:

Quote:
Do you mean if somebody types /example in chat , like an admin or player , you want it so that /example does not appear. If so using the above code is what you need. It blocks the /example from being displayed in chat but will still print the message "Printing some message from using /saysomething say command" or execute some function from that command without displaying /example to everyone in the chat.
... except that he wants to hide the command triggering chat messages regardless of what plugin provides the command. He wants to block ALL messages that start with / from appearing in the chat, but still allow use of commands with /.

So let's say that he has a plugin that provides a /knife command. He wants an ADDITIONAL PLUGIN which blocks "/knife" from appearing in the chat, while also letting the knife plugin provide knives.
__________________

Last edited by ddhoward; 03-19-2018 at 02:55.
ddhoward is offline
CookieCrumbler
Senior Member
Join Date: Feb 2013
Location: Australia
Old 03-19-2018 , 03:11   Re: Hide slash messages
Reply With Quote #7

This is what either of the two blocks of code in the second post do.
__________________
--------------------------------------------------
C is for cookie ... thats good enuff 4 me
CookieCrumbler is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 03-19-2018 , 13:35   Re: Hide slash messages
Reply With Quote #8

The code you've posted there, I tried that too, as I mentioned, none of those codes that could be found on internet is working in my case.

Quote:
... except that he wants to hide the command triggering chat messages regardless of what plugin provides the command. He wants to block ALL messages that start with / from appearing in the chat, but still allow use of commands with /.

So let's say that he has a plugin that provides a /knife command. He wants an ADDITIONAL PLUGIN which blocks "/knife" from appearing in the chat, while also letting the knife plugin provide knives.
You got this right.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2018 , 13:41   Re: Hide slash messages
Reply With Quote #9

None of the codes are working because you already have a plugin that has full control over the chat (admin prefix, chat rank, gag system, etc).
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 03-19-2018 , 14:01   Re: Hide slash messages
Reply With Quote #10

Yes I do use such things, so what can I do in this case?
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
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 19:17.


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