Raised This Month: $12 Target: $400
 3% 

Disable teamkill notification


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BoBzY
AlliedModders Donor
Join Date: Aug 2010
Location: Bruxelles
Old 08-08-2011 , 13:43   Disable teamkill notification
Reply With Quote #1

Hello,

anyway to disable this
Code:
 ツ Colly. attacked a teammate
 ツ Colly. attacked a teammate
 ツ Colly. attacked a teammate
?

With mp_friendlyfire enabled ofc =)

ty
BoBzY is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 08-08-2011 , 17:42   Re: Disable teamkill notification
Reply With Quote #2

Try this. Don't know for sure where those chat messages are generated though..
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_hurt"Event_OnPlayerHurtEventHookMode_Pre);
}

public 
Action:Event_OnPlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    if(
client && attacker <= MaxClients && IsClientInGame(client) && IsClientInGame(attacker) && GetClientTeam(client) == GetClientTeam(attacker))
    {
        
dontBroadcast true;
        return 
Plugin_Changed;
    }
    return 
Plugin_Continue;

__________________
Peace-Maker is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-08-2011 , 17:43   Re: Disable teamkill notification
Reply With Quote #3

This remove "team mate attack" only from players chat, it will still show messages in server console.
PHP Code:
public OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("TextMsg"), TextMsgtrue);
}

public 
Action:TextMsg(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{
    
decl String:buffer[100];
    
buffer[0] = '\0';
    
BfReadString(bfbuffersizeof(buffer), false);

    if(
StrContains(buffer"Game_teammate_attack") != -1)
    {
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;

*edit
@Peace-Maker that didn't work, just tested

*edit edit
Heh, found same code after I did this one
disable "attacked a teammate" messages.

Last edited by Bacardi; 08-09-2011 at 07:31.
Bacardi is offline
BoBzY
AlliedModders Donor
Join Date: Aug 2010
Location: Bruxelles
Old 08-08-2011 , 17:49   Re: Disable teamkill notification
Reply With Quote #4

Thanks ! ^^

@Bacardi it works fine =)

Last edited by BoBzY; 08-09-2011 at 05:48.
BoBzY is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 08-08-2011 , 17:55   Re: Disable teamkill notification
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
*edit
@Peace-Maker that didn't work, just tested
Alrighty - nevermind then
__________________
Peace-Maker is offline
Reply



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 22:19.


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