AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block Message for deathmatch ffa (https://forums.alliedmods.net/showthread.php?t=345787)

AlexWinchester 01-30-2024 11:23

Block Message for deathmatch ffa
 
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,

https://steamuserimages-a.akamaihd.n...DE8E77000F0D9/
https://steamuserimages-a.akamaihd.n...349C19090385F/
https://steamuserimages-a.akamaihd.n...70D5374A5D0DE/

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,

mlibre 01-30-2024 12:51

Re: Block Message for deathmatch ffa
 
Quote:

Originally Posted by ConnorMcLeod (Post 1186895)
PHP Code:

#include <amxmodx>

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




AlexWinchester 01-30-2024 13:31

Re: Block Message for deathmatch ffa
 
It worked! Thank you

mlibre 01-30-2024 18:38

Re: Block Message for deathmatch ffa
 
you're welcome, the one that sneaks away is #Spec_Duck, this method does not cover it


All times are GMT -4. The time now is 08:55.

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