View Single Post
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