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() < 2 || get_msg_argtype(2) != ARG_STRING)
return PLUGIN_CONTINUE;
static textmsg[22];
get_msg_arg_string(2, textmsg, charsmax(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_message( get_user_msgid( "TextMsg" ), "OnTextMsg_Message" )
}
public OnTextMsg_Message( iMsgId, iMsgDest, id )
{
if( !id && get_msg_arg_int( 1 ) == print_center )
{
new szMessage[ 32 ]
get_msg_arg_string( 2, szMessage, charsmax( szMessage ) )
if( equal( szMessage, "#Game_teammate_attack") || equal( szMessage, "#Killed_Teammate" ) || equal( szMessage, "#Cstrike_TitlesTXT_Hint_careful_around_teammates" ) || equal( szMessage, "#Cstrike_TitlesTXT_Hint_try_not_to_injure_teammates" ) || equal( szMessage, "#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(2, szBuffer, 39)
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(2, message, charsmax(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,
|