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

Hide slash messages


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2018 , 14:05   Re: Hide slash messages
Reply With Quote #11

Edit the plugin you're using.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 03-19-2018 , 16:45   Re: Hide slash messages
Reply With Quote #12

I got that much idea, but how, I use different plugin for knife menu, for duels, level/flag tags and so on, am I supposed to edit all of them?
__________________

Last edited by SomewhereLost; 03-19-2018 at 16:45.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-19-2018 , 17:39   Re: Hide slash messages
Reply With Quote #13

No, you're supposed to edit the plugin that hooks the "say" and "say_team" commands and returns PLUGIN_HANDLED in the end of their functions, thus blocking the entire chat for any other plugin below it.
__________________

Last edited by OciXCrom; 03-19-2018 at 17:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 03-19-2018 , 17:48   Re: Hide slash messages
Reply With Quote #14

What if there's few of them which hooks those say/say_team commands.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
CookieCrumbler
Senior Member
Join Date: Feb 2013
Location: Australia
Old 03-20-2018 , 04:55   Re: Hide slash messages
Reply With Quote #15

Then just do it to all of them.

You could have just hardcoded return PLUGIN_HANDLED at the end of every function where ever slash commands are used in any of your plugins and you would have achieved what you wanted already.

See the first example in the second post of the thread ... just do that in everyplace in your plugins code where a say command function is used in your code.
__________________
--------------------------------------------------
C is for cookie ... thats good enuff 4 me

Last edited by CookieCrumbler; 03-20-2018 at 05:03.
CookieCrumbler is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-20-2018 , 10:10   Re: Hide slash messages
Reply With Quote #16

There can't be more than one. If there's more, only the one that's highest in plugins.ini is working properly and all other plugins below it are blocked by it.
I'm talking specifically about the "say" and "say_team" commands themselves, not "say /something" or "say_team /something".
__________________

Last edited by OciXCrom; 03-20-2018 at 10:11.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
massouh2004
Junior Member
Join Date: Mar 2018
Location: Casablanca, Morocco.
Old 03-22-2018 , 14:00   Re: Hide slash messages
Reply With Quote #17

Quote:
Originally Posted by CookieCrumbler View Post
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;   

Please explaine to me why you used this code and by what we should name it?

PHP Code:
    if ( whatever == something 
    { 
massouh2004 is offline
CookieCrumbler
Senior Member
Join Date: Feb 2013
Location: Australia
Old 03-22-2018 , 19:33   Re: Hide slash messages
Reply With Quote #18

the if statement is a conditional , which means those conditions must be met before it will continue to execute anything under it.

eg:

if (is_user_alive(id) && cs_get_user_team(id) == TERRORIST)
{
>>>execute the code that is here
}

is saying that those 2 conditions must be met before if will execute the code inside { }

things like || , && , == , >= mean
and, or , equal to , greater then or equal to

you can learn about them here
https://wiki.alliedmods.net/Pawn_Tutorial#Conditionals
__________________
--------------------------------------------------
C is for cookie ... thats good enuff 4 me
CookieCrumbler is offline
massouh2004
Junior Member
Join Date: Mar 2018
Location: Casablanca, Morocco.
Old 03-23-2018 , 14:16   Re: Hide slash messages
Reply With Quote #19

Thank you very much, CookieCrumbler.
massouh2004 is offline
Reply


Thread Tools
Display Modes

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 08:25.


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