Raised This Month: $32 Target: $400
 8% 

Solved block teamattack message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The overrated maniac
Member
Join Date: Jun 2021
Location: Argentina
Old 01-07-2022 , 16:22   block teamattack message
Reply With Quote #1

For a jailbreak mod, when a terrorist attack another terrorist, the message on say says "x attacked a teammate" I want to remove it. I tryed this

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("D7 block saytext team attack""0.0.1""D i 5 7 i n c T, Johnny got his gun")
    
    
register_message(get_user_msgid("SayText"), "message_SayText")
}

// Credits to Johnny got his gun
public message_SayText()
{
    if (
get_msg_args() > 4)
        return 
PLUGIN_CONTINUE;
    
    static 
szBuffer[40];
    
get_msg_arg_string(2szBuffer39)
    
    if (!
equali(szBuffer"#Cstrike_TitlesTXT_Game_teammate_attack"))
        return 
PLUGIN_CONTINUE;
    
    return 
PLUGIN_HANDLED;

and this (with the plugin init obv)

PHP Code:
public message_SayText()
{
    if (
get_msg_args() > 4)
        return 
PLUGIN_CONTINUE;
    
    static 
szBuffer[23];
    
get_msg_arg_string(2szBuffer22)
    
    if (!
equali(szBuffer"#C4_Plant_At_Bomb_Spot") )
    {
        return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_HANDLED;

They dont work and I checked jbextreme and no idea how he does it.
Post from the functions: https://forums.alliedmods.net/showth...20#post2180920
Post from jbextreme: https://forums.alliedmods.net/showthread.php?p=1113644
Example image from the text to remove:

Last edited by The overrated maniac; 01-07-2022 at 18:54. Reason: Solved
The overrated maniac is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-07-2022 , 17:28   Re: block teamattack message
Reply With Quote #2

Remove "Cstrike_TitlesTXT_" from the first code.
The message code is "#Game_teammate_attack".

You can also use my plugin to modify/block any message - https://forums.alliedmods.net/showthread.php?t=282218
You can get a full list of messages in resource/cstrike_english.txt. Again, the "Cstrike_TitlesTXT_" part needs to be ommited.
__________________

Last edited by OciXCrom; 01-07-2022 at 17:30.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
The overrated maniac
Member
Join Date: Jun 2021
Location: Argentina
Old 01-07-2022 , 18:09   Re: block teamattack message
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Remove "Cstrike_TitlesTXT_" from the first code.
The message code is "#Game_teammate_attack".

You can also use my plugin to modify/block any message - https://forums.alliedmods.net/showthread.php?t=282218
You can get a full list of messages in resource/cstrike_english.txt. Again, the "Cstrike_TitlesTXT_" part needs to be ommited.

still not working:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("D7 block saytext team attack""0.0.1""D i 5 7 i n c T, Johnny got his gun")
    
    
register_message(get_user_msgid("SayText"), "message_SayText")
}

// Credits to Johnny got his gun
public message_SayText()
{
    if (
get_msg_args() > 4)
        return 
PLUGIN_CONTINUE;
    
    static 
szBuffer[40];
    
get_msg_arg_string(2szBuffer39)
    
    if (!
equali(szBuffer"#Game_teammate_attack"))
        return 
PLUGIN_CONTINUE;
    
    return 
PLUGIN_HANDLED;

The message in cstrike_english.txt is Cstrike_TitlesTXT_Game_teammate_attack

I dont like to use a plugin like that only for block 1 message, but if its the only way, I will

Last edited by The overrated maniac; 01-07-2022 at 18:14.
The overrated maniac is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-07-2022 , 18:33   Re: block teamattack message
Reply With Quote #4

It isn't SayText, it is TextMsg.

https://github.com/s1lentq/ReGameDLL...ayer.cpp#L1072
https://github.com/s1lentq/ReGameDLL.../util.cpp#L660

Code:
#include <amxmodx> public plugin_init() {     register_plugin("D7 block saytext team attack", "0.0.1", "D i 5 7 i n c T, Johnny got his gun")         register_message(get_user_msgid("TextMsg"), "message_TextMsg") } // Credits to Johnny got his gun public message_TextMsg() {     new szBuffer[40];     get_msg_arg_string(2, szBuffer, 39)         if (!equali(szBuffer, "#Game_teammate_attack"))         return PLUGIN_CONTINUE;         return PLUGIN_HANDLED; }
__________________









Last edited by CrazY.; 01-07-2022 at 18:37.
CrazY. is offline
The overrated maniac
Member
Join Date: Jun 2021
Location: Argentina
Old 01-07-2022 , 18:54   Re: block teamattack message
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
It isn't SayText, it is TextMsg.

https://github.com/s1lentq/ReGameDLL...ayer.cpp#L1072
https://github.com/s1lentq/ReGameDLL.../util.cpp#L660

Code:
#include <amxmodx> public plugin_init() {     register_plugin("D7 block saytext team attack", "0.0.1", "D i 5 7 i n c T, Johnny got his gun")         register_message(get_user_msgid("TextMsg"), "message_TextMsg") } // Credits to Johnny got his gun public message_TextMsg() {     new szBuffer[40];     get_msg_arg_string(2, szBuffer, 39)         if (!equali(szBuffer, "#Game_teammate_attack"))         return PLUGIN_CONTINUE;         return PLUGIN_HANDLED; }
Thanks, it worked
The overrated maniac is offline
sb123
Senior Member
Join Date: Jan 2007
Old 01-08-2022 , 00:23   Re: block teamattack message
Reply With Quote #6

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin(...)
    
set_msg_block(get_user_msgid("TextMsg"), BLOCK_SET)

__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-08-2022 , 06:07   Re: block teamattack message
Reply With Quote #7

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

public plugin_init()
{
    
register_plugin(...)
    
set_msg_block(get_user_msgid("TextMsg"), BLOCK_SET)

This will block all the Text messages that are sent to the client which is not what the OP wants.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
sb123
Senior Member
Join Date: Jan 2007
Old 01-08-2022 , 06:45   Re: block teamattack message
Reply With Quote #8

PHP Code:
/* Copyright by KaLoSZyFeR */

#include <amxmodx>

#define PLUGIN "Block Messages"
#define VERSION "0.1"
#define AUTHOR "KaLoSZyFeR"

#define AMOUNT 128        // amount of texts in tables or something (I don't know how it is in english)



public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg"), "message")
}

new 
text[AMOUNT][] = {
    
"#Target_Bombed",
    
"#VIP_Escaped",
    
"#VIP_Assassinated",
    
"#Terrorists_Escaped",
    
"#CTs_PreventEscape",
    
"#Escaping_Terrorists_Neutralized",
    
"#Bomb_Defused",
    
"#CTs_Win",
    
"#Terrorists_Win",
    
"#Round_Draw",
    
"#All_Hostages_Rescued",
    
"#Target_Saved",
    
"#Hostages_Not_Rescued",
    
"#Terrorists_Not_Escaped",
    
"#VIP_Not_Escaped",
    
"#Cannot_Buy_This",
    
"#Not_Enough_Money",
    
"#Weapon_Not_Available",
    
"#Already_Have_Kevlar",
    
"#Already_Have_Kevlar_Helmet",
    
"#Already_Have_Kevlar_Bought_Helmet",
    
"#Already_Have_Helmet_Bought_Kevlar",
    
"#Cannot_Carry_Anymore",
    
"#Already_Have_One",
    
"#Cannot_Switch_From_VIP",
    
"#All_Teams_Full",
    
"#Terrorists_Full",
    
"#CTs_Full",
    
"#Too_Many_Terrorists",
    
"#Too_Many_CTs",
    
"#Wait_3_Seconds",
    
"#Only_1_Team_Change",
    
"#Ignore_Broadcast_Messages",
    
"#Ignore_Broadcast_Team_Messages",
    
"#Accept_All_Messages",
    
"#Ignore_Radio",
    
"#Accept_Radio",
    
"#Command_Not_Available",
    
"#Defusing_Bomb_With_Defuse_Kit",
    
"#Defusing_Bomb_Without_Defuse_Kit",
    
"#Killed_Hostage",
    
"#Injured_Hostage",
    
"#Auto_Team_Balance_Next_Round",
    
"#All_VIP_Slots_Full",
    
"#Killed_Teammate",
    
"#Banned_For_Killing_Teammates",
    
"#Cannot_Vote_Map",
    
"#Weapon_Cannot_Be_Dropped",
    
"#Terrorist_Escaped",
    
"#C4_Plant_At_Bomb_Spot",
    
"#C4_Plant_Must_Be_On_Ground",
    
"#C4_Arming_Cancelled",
    
"#Bomb_Planted",
    
"#C4_Activated_At_Bomb_Spot",
    
"#Switch_To_BurstFire",
    
"#Switch_To_SemiAuto",
    
"#Switch_To_FullAuto",    /* TUTAJ KONIEC */
    
"#GAMESAVED",
    
"#Game_Commencing",
    
"#Game_connected",
    
"#Game_disconnected",
    
"#Game_join_terrorist",
    
"#Game_join_ct",
    
"#Game_join_terrorist_auto",
    
"#Game_join_ct_auto",
    
"#Game_scoring",
    
"#Game_idle_kick",
    
"#Game_bomb_drop",
    
"#Game_bomb_pickup",
    
"#Game_no_timelimit",
    
"#Game_timelimit",
    
"#Game_unknown_command",
    
"#Game_in_position",
    
"#Game_added_position",
    
"#Game_teammate_kills",
    
"#Game_required_votes",
    
"#Game_teammate_attack",
    
"#Game_kicked",
    
"#Game_vote_cast",
    
"#Game_vote_usage",
    
"#Game_vote_player_not_found",
    
"#Game_vote_players_on_your_team",
    
"#Game_vote_not_yourself",
    
"#Game_voted_for_map",
    
"#Game_votemap_usage",
    
"#Cannot_Vote_Need_More_People",
    
"#Map_Vote_Extend",
    
"#Cannot_Vote_With_Less_Than_Three",
    
"#Game_will_restart_in",    /* TUTAJ KONIEC DRUGIEJ CZESCI */
    
"#Cant_buy",
    
"#VIP_cant_buy",
    
"#CT_cant_buy",
    
"#Terrorist_cant_buy",
    
"#Vote",
    
"#Votes",    /* TUTAJ KONIEC TRZECIEJ CZESCI */
    
"#Got_defuser",
    
"#Got_bomb",
    
"#Cannot_Be_Spectator",
    
"#Muted",
    
"#Unmuted",
    
"#No_longer_hear_that_player",
    
"#Name_change_at_respawn",
    
"#C4_Defuse_Must_Be_On_Ground",
    
"#Spec_Mode1",
    
"#Spec_Mode2",
    
"#Spec_Mode3",
    
"#Spec_Mode4",
    
"#Spec_Mode5",
    
"#Spec_Mode6",
    
"#Spec_NoTarget",
    
"#Spec_Help_Title",
    
"#Spec_Slow_Motion",
    
"#Spec_Replay",
    
"#Spec_Auto",
    
"#Spec_Time",
    
"#Spec_Map",
    
"#Spectators",
    
"#Unassigned",
    
"#Only_CT_Can_Move_Hostages",
    
"#Spec_Duck",
    
"#Spec_Not_Valid_Choice",
    
"#Spec_Not_In_Spectator_Mode",
    
"#Spec_NoPlayers",
    
"#Spec_ListPlayers",
    
"#Selection_Not_Available",
    
"#Alias_Not_Avail",
    
"#Spec_No_PIP",
    
"#Cstrike_Already_Own_Weapon"
}

public 
message()
{
    if(
get_msg_argtype(2) != ARG_STRING)
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
arg2[32]
    
get_msg_arg_string(2arg231)    
    
    if(
get_msg_args() == )
    {
        new 
arg3[20],arg4[20]
        
get_msg_arg_string(3arg319)
        
get_msg_arg_string(4arg419)
        
        for(new 
0AMOUNTi++)
        {
            if(
equal(arg2text[i]))
            {
                return 
PLUGIN_HANDLED
            
}
        }
    }    
    else if(
get_msg_args() == )
    {
        new 
arg3[20]
        
get_msg_arg_string(3arg319)
        
        for(new 
0AMOUNTi++)
        {
            if(
equal(arg2text[i]))
            {
                
                return 
PLUGIN_HANDLED
            
}
        }
    }    
    else
    {
        for(new 
0AMOUNTi++)
        {
            if(
equal(arg2text[i]))
            {
                
                return 
PLUGIN_HANDLED
            
}
        }
    }
    return 
PLUGIN_CONTINUE

__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-08-2022 , 07:40   Re: block teamattack message
Reply With Quote #9

Quote:
Originally Posted by Natsheh View Post
This will block all the Text messages that are sent to the client which is not what the OP wants.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-08-2022 , 10:57   Re: block teamattack message
Reply With Quote #10

Quote:
Originally Posted by sb123 View Post
[PHP]/* Copyright by KaLoSZyFeR */
Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
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 02:05.


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