AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Remove Teamattack message (https://forums.alliedmods.net/showthread.php?t=256215)

cen0x 01-24-2015 14:54

Remove Teamattack message
 
Heya,

I want to remove the Teamattack message for cs;go but I cant found how it works. I tried already PreHook and change the Broadcast bool but its not work. Does anyone know how it works?

regards
cen0x

Leonardo 01-24-2015 16:16

Re: Remove Teamattack message
 
Not sure if it'll work in cago, but in older games you could simply block a specific chat text ('SayText' or 'SayText2' usermessage) coming from user #0

cen0x 01-25-2015 14:43

Re: Remove Teamattack message
 
I have no idea how to solve it^^

Dkmuniz 01-25-2015 17:26

Re: Remove Teamattack message
 
PHP Code:

public Action:Event_TextMsg(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{

    
decl String:text[64];
    if (
GetUserMessageType() == UM_Protobuf)
        
PbReadString(bf"params"textsizeof(text), 0);
    else
        
BfReadString(bftextsizeof(text));
    
    if (
StrContains(text"#SFUI_Notice_Killed_Teammate") != -1)
        return 
Plugin_Handled;
    
    if (
StrContains(text"#Cstrike_TitlesTXT_Game_teammate_attack") != -1)
        return 
Plugin_Handled;
    
    if (
StrContains(text"#Hint_try_not_to_injure_teammates") != -1)
        return 
Plugin_Handled;

    return 
Plugin_Continue;
}

public 
Action:Event_HintText(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{

    
decl String:text[64];
    if (
GetUserMessageType() == UM_Protobuf)
        
PbReadString(bf"text"textsizeof(text));
    else
        
BfReadString(bftextsizeof(text));

    if (
StrContains(text"#SFUI_Notice_Hint_careful_around_teammates") != -1)
        return 
Plugin_Handled;

    return 
Plugin_Continue;


PHP Code:

public OnPluginStart()
{
HookUserMessage(GetUserMessageId("TextMsg"), Event_TextMsgtrue);
HookUserMessage(GetUserMessageId("HintText"), Event_HintTexttrue);




cen0x 01-27-2015 20:14

Re: Remove Teamattack message
 
It works, thank u.


All times are GMT -4. The time now is 12:51.

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