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

Block Message for deathmatch ffa


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlexWinchester
Junior Member
Join Date: May 2023
Old 01-30-2024 , 11:23   Block Message for deathmatch ffa
Reply With Quote #1

Hello everyone i'm using amxmodx 1.8.3,
And i have a problem with blocking some messages for ffa

i'm trying to block these on the 3 pictures,





i tried 3 different ways,

I tried to code it inside the dm_ffa like this to try block it
PHP Code:
public Msg_TextMsg()
{
    if (
get_msg_args() < || get_msg_argtype(2) != ARG_STRING)
        return 
PLUGIN_CONTINUE;
    
    static 
textmsg[22];
    
get_msg_arg_string(2textmsgcharsmax(textmsg));
    if (
equal(textmsg"#Game_teammate_attack") || equal(textmsg"#Killed_Teammate") || equal(textmsg"#Cstrike_TitlesTXT_Hint_careful_around_teammates") || equal(textmsg"#Cstrike_TitlesTXT_Hint_try_not_to_injure_teammates") || equal(textmsg"#Cstrike_TitlesTXT_Hint_spotted_a_friend" ))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;

and i tried this one
PHP Code:
#include < amxmodx >

public plugin_init( )
{
    
register_messageget_user_msgid"TextMsg" ), "OnTextMsg_Message" )
}

public 
OnTextMsg_MessageiMsgIdiMsgDestid )
{
    if( !
id && get_msg_arg_int) == print_center )
    {
        new 
szMessage32 ]
        
get_msg_arg_string2szMessagecharsmaxszMessage ) )
        if( 
equalszMessage"#Game_teammate_attack") || equalszMessage"#Killed_Teammate" ) || equalszMessage"#Cstrike_TitlesTXT_Hint_careful_around_teammates" ) || equalszMessage"#Cstrike_TitlesTXT_Hint_try_not_to_injure_teammates" ) || equalszMessage"#Cstrike_TitlesTXT_Hint_spotted_a_friend" )  )
        {
            return 
1
        
}
    }
    return 
0

and i tried this one
PHP Code:
#include <amxmodx> 

public plugin_init() 

    
register_plugin"Block Messages""2.0""X" ); 
 
    
register_message(get_user_msgid("SayText"), "message_SayText"
    
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")


public 
message_SayText() 

    if (
get_msg_args() > 4
        return 
PLUGIN_CONTINUE
     
    static 
szBuffer[40]; 
    
get_msg_arg_string(2szBuffer39)
    
    if (!
equali(szBuffer"#Cstrike_TitlesTXT_Hint_careful_around_teammates"))
        {
            return 
PLUGIN_CONTINUE;
        }
        
    if (!
equali(szBuffer"#Cstrike_TitlesTXT_Hint_try_not_to_injure_teammates"))
        {
            return 
PLUGIN_CONTINUE;
        }

    if (!
equali(szBuffer"#Cstrike_TitlesTXT_Hint_spotted_a_friend"))
        {
            return 
PLUGIN_CONTINUE;
        }

    return 
PLUGIN_HANDLED;
}

public 
message_TextMsg( const MsgId, const MsgDest, const MsgEntity )
{     
    static 
message[32
    
get_msg_arg_string(2messagecharsmax(message))
 
    if(
equal(message"#Game_will_restart_in"))
    { 
        return 
PLUGIN_HANDLED;
    } 
    return 
PLUGIN_CONTINUE;

None of them worked i did try to search for solutions but came up empty,
AlexWinchester is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 01-30-2024 , 12:51   Re: Block Message for deathmatch ffa
Reply With Quote #2

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Block""Hud""TextArgs")
    
set_msg_block(get_user_msgid("HudTextArgs"), BLOCK_SET)

__________________
mlibre is offline
AlexWinchester
Junior Member
Join Date: May 2023
Old 01-30-2024 , 13:31   Re: Block Message for deathmatch ffa
Reply With Quote #3

It worked! Thank you
AlexWinchester is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 01-30-2024 , 18:38   Re: Block Message for deathmatch ffa
Reply With Quote #4

you're welcome, the one that sneaks away is #Spec_Duck, this method does not cover it
__________________
mlibre 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 18:40.


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