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

Solved Block message when someone types ff in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Watermelonnable
Member
Join Date: Feb 2017
Old 12-04-2019 , 11:27   Block message when someone types ff in chat
Reply With Quote #1

Hello guys.

I want to block the message that appears when someone types "ff" in the chat (Friendly fire: on/off) because smart players of the mode I'm working on exploit this to tell the alive players who's the enemy.

I thought this would be enough but it didn't work.

PHP Code:
#include <amxmodx>

#define PLUGIN            "TTT - Block FF Command"
#define VERSION            "1.0"
#define AUTHOR          "Watermelonnable"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say ff""BlockFF");
    
register_clcmd("say_team ff""BlockFF")
}

public 
BlockFF()
{
    return 
PLUGIN_HANDLED_MAIN;

Any hint to achieve this? Thank you!

Last edited by Watermelonnable; 12-04-2019 at 18:16.
Watermelonnable is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 12-04-2019 , 11:46   Re: Block message when someone types ff in chat
Reply With Quote #2

Quote:
Originally Posted by Watermelonnable View Post
Hello guys.

I want to block the message that appears when someone types "ff" in the chat (Friendly fire: on/off) because smart players of the mode I'm working on exploit this to tell the alive players who's the enemy.

I thought this would be enough but it didn't work.

PHP Code:
#include <amxmodx>

#define PLUGIN            "TTT - Block FF Command"
#define VERSION            "1.0"
#define AUTHOR          "Watermelonnable"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_clcmd("say ff""BlockFF");
    
register_clcmd("say_team ff""BlockFF")
}

public 
BlockFF()
{
    return 
PLUGIN_HANDLED_MAIN;

Any hint to achieve this? Thank you!
In nexstmap.sma look for register_clcmd("say ff" and remove it and it's code.
Or you can use Orpheu and hook pfnClientCommand then block it by checking the arguments if they match ^say ff^ if you want to be resistent on AMXX updates without having to edit that plug-in.

Last edited by DarthMan; 12-04-2019 at 11:47.
DarthMan is offline
Watermelonnable
Member
Join Date: Feb 2017
Old 12-04-2019 , 12:09   Re: Block message when someone types ff in chat
Reply With Quote #3

Thank you. I wanted to do the fix with orpheu but I know nothing about it so I went with the first solution

Last edited by Watermelonnable; 12-04-2019 at 12:09.
Watermelonnable is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 12-04-2019 , 14:25   Re: Block message when someone types ff in chat
Reply With Quote #4

Quote:
Originally Posted by Watermelonnable View Post
Thank you. I wanted to do the fix with orpheu but I know nothing about it so I went with the first solution
There are tutorials about Orpheu.
Read, read, read, learn, learn, learn and search, search, search before asking how.
Everything you will need you can find on this forum.

Last edited by DarthMan; 12-04-2019 at 14:26.
DarthMan is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-04-2019 , 15:45   Re: Block message when someone types ff in chat
Reply With Quote #5

There's no need to use Orpheu for such a simple thing, it's overkill. The method you used works just fine. You can also catch the message itself and block it, but there's really no need to.
__________________

Last edited by OciXCrom; 12-04-2019 at 15:45.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-05-2019 , 08:41   Re: Block message when someone types ff in chat
Reply With Quote #6

pfnClientCommand can be hooked with fakemeta.
As a general rule however:fakemeta will not catch functions called by plugins, only calls from gamedll.
__________________
HamletEagle is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 12-05-2019 , 11:38   Re: Block message when someone types ff in chat
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
pfnClientCommand can be hooked with fakemeta.
As a general rule however:fakemeta will not catch functions called by plugins, only calls from gamedll.
That's the point. He can't use Fakemeta in this case, Orpheu remains the better alternative.
But sure, for such a plug-in, it may not be needed.
DarthMan is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-05-2019 , 21:06   Re: Block message when someone types ff in chat
Reply With Quote #8

Occam's razor. Don't make it more complicated that it needs to be. Just edit nextmap.sma and recompile. If you don't like that, the plugin that you posted will work as long as it is listed before any plugins that also hook that message.
__________________

Last edited by fysiks; 12-05-2019 at 21:08.
fysiks 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 04:57.


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