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

[Cs:s & Cs:go]Teammate attack show all


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Plugin ID:
2635
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Replace regular teammate attack chat announce to show all with team color
    Old 11-03-2011 , 18:47   [Cs:s & Cs:go]Teammate attack show all
    Reply With Quote #1

    Rate Thread

    [Cs:s & Cs:go]Teammate attack show all
    - Replace regular teammate attack chat announce to show all with team color
    *Don't know would this work in other modes than Cs:s

    Simple plugin, maybe useless for you.
    "Game announce in chat team mate attacks only to players who are in same team."
    This plugin follow those team attack usermessages, prevent show this normal chat message and make new one to show all players.

    Quote:
    Game regular chat announce = Bacardi attacked a teammate
    New chat announce = [SM] Bacardi attacked a teammate.
    When server enable mp_friendlyfire, plugin start hook one of usermessages and replace team attack announce.
    And disabling mp_friendlyfire, plugin unhook usermessage and do nothing.



    Translation included. Copy phrases from game translation files.
    English, 1337speak, Brazilian Portuguese, Chinese Simplified, Chinese Traditional, Czech, Danish,
    Dutch, Finnish, French, German, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Romanian,
    Russian, Spanish, Swedish, Turkish


    Installation:
    • Get Plugin and move teamattack_show_all.smx in your server ...addons\sourcemod\plugins\
    • teamattack_show_all.phrases.txt to ...addons\sourcemod\translations\


    Credits:
    Thanks for all new and old developers in this forum, posting much information.

    Other:
    Have done before, but now better Showing Team Attacks in Chat

    *update 8.11.2011, version 0.4
    - optimize, take new Handle out from loop.

    *update 22.11.2011, version 0.5
    - Fix error when team attacker disconnect (or get kick) before message printed
    - Change Datatimer delay 0.1 to 0.01

    *update 18.9.2015, version 1.0
    - Support Cs:go
    Attached Files
    File Type: txt teamattack_show_all.phrases.txt (1.3 KB, 1040 views)
    File Type: sp Get Plugin or Get Source (teamattack_show_all.sp - 1444 views - 3.0 KB)

    Last edited by Bacardi; 09-18-2015 at 13:34. Reason: remove links from installation decription
    Bacardi is offline
    Fearts
    ferts of daeth
    Join Date: Oct 2008
    Old 11-03-2011 , 19:04   Re: [Cs:s]Teammate attack show all
    Reply With Quote #2

    Nice little addition.
    __________________
    Fearts is offline
    sinblaster
    Grim Reaper
    Join Date: Feb 2010
    Location: Australia
    Old 11-04-2011 , 16:30   Re: [Cs:s]Teammate attack show all
    Reply With Quote #3

    Quote:
    1337speak
    __________________
    Happy Happy Joy Joy

    sinblaster is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 11-04-2011 , 18:25   Re: [Cs:s]Teammate attack show all
    Reply With Quote #4

    Quote:
    Originally Posted by sinblaster View Post
    Before you enter your server, type your own console
    cl_language 1337speak
    and tadaa.

    Can change to other language but need re-connect to server.
    This not change game language (need do from via steam settings), SM translations yes.

    *edit
    game itself not have language 1337speak...
    __________________
    Do not Private Message @me

    Last edited by Bacardi; 11-04-2011 at 18:26.
    Bacardi is offline
    ASTFA
    Member
    Join Date: Jun 2011
    Old 11-07-2011 , 07:36   Re: [Cs:s]Teammate attack show all
    Reply With Quote #5

    This is just what I'm looking for.. but could you do a 'classic' mode where, say I'm a CT, and someone team attacks on my team, the chat would show:

    XXXXX attacked a teammate

    and if they are on the opposite team:

    (T) XXXXX attacked a teammate

    ??

    Thanks, Bacardi
    __________________

    ASTFA is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 11-07-2011 , 09:27   Re: [Cs:s]Teammate attack show all
    Reply With Quote #6

    Quote:
    Originally Posted by ASTFA View Post
    This is just what I'm looking for.. but could you do a 'classic' mode where, say I'm a CT, and someone team attacks on my team, the chat would show:

    XXXXX attacked a teammate

    and if they are on the opposite team:

    (T) XXXXX attacked a teammate

    ??

    Thanks, Bacardi
    Here, compile yourself.
    You not need translation file from first post.
    I'm not going support this.

    PHP Code:
    public Plugin:myinfo = {
        
    name "[Cs:s]Teammate attack show all",
        
    author "Bacardi",
        
    description "Show all players team attacker in chat",
        
    version "unsupported"
    };

    new 
    Handle:mp_friendlyfire INVALID_HANDLE;

    public 
    OnPluginStart()
    {
        if((
    mp_friendlyfire FindConVar("mp_friendlyfire")) == INVALID_HANDLE)
        {
            
    SetFailState("Missing mp_friendlyfire");
        }
        
    HookConVarChange(mp_friendlyfireconvar_change);

        if(
    GetConVarBool(mp_friendlyfire))
        {
            
    convar_change(mp_friendlyfire"0""1");
        }
    }

    public 
    convar_change(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        if(
    convar == mp_friendlyfire)
        {
            
    decl bool:oldvbool:friendlyfire;
            
    oldv StringToInt(oldValue) != 0;

            if((
    friendlyfire GetConVarBool(mp_friendlyfire)) != oldv)
            {
                if(
    friendlyfire)
                {
                    
    HookUserMessage(GetUserMessageId("TextMsg"), TextMsgtrue);
                }
                else
                {
                    
    UnhookUserMessage(GetUserMessageId("TextMsg"), TextMsgtrue);
                }
            }
        }
    }

    public 
    Action:TextMsg(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
    {
        
    decl String:buffer[MAX_NAME_LENGTH];
        
    buffer[0] = '\0';
        
    BfReadString(bfbuffersizeof(buffer), false); // Message
        
    if(StrContains(buffer"Game_teammate_attack") != -1// Message match
        
    {
            
    BfReadString(bfbuffersizeof(buffer), false); // Get name
            
    decl String:name[MAX_NAME_LENGTH];
            
    GetClientName(players[0], namesizeof(name)); // Get name of player who get this usermsg

            
    if(StrEqual(buffername)) // Team attacker name match player name who get this usermsg.
            
    {
                new 
    Handle:pack;
                
    CreateDataTimer(0.1msgpack); // Print new message after this usermessage
                
    WritePackCell(packplayers[0]);
            }
        }

        return 
    Plugin_Continue;
    }

    public 
    Action:msg(Handle:timerHandle:pack)
    {
        
    decl clientString:buffer[128], team;
        
    ResetPack(pack);
        
    client ReadPackCell(pack);
        
    team GetClientTeam(client);

        for(new 
    1<= MaxClientsi++)
        {
            if(
    IsClientInGame(i) && !IsFakeClient(i) && GetClientTeam(i) != team)
            {
                
    Format(buffersizeof(buffer), "(%s) %N attacked a teammate."team == "CT":(team == "T":"SPEC"), client); // Make new message
                
    PrintToChat(ibuffer);
            }
        }

    __________________
    Do not Private Message @me
    Bacardi is offline
    ASTFA
    Member
    Join Date: Jun 2011
    Old 11-08-2011 , 01:44   Re: [Cs:s]Teammate attack show all
    Reply With Quote #7

    Thanks Bacadi, I do like the colouring of the teams design unfortunately I'm trying to build up a new server and would prefer less 'signs of customisation' for the time being.

    Ty for the code anyway!! =)
    __________________

    ASTFA is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 11-08-2011 , 11:23   Re: [Cs:s]Teammate attack show all
    Reply With Quote #8

    update 0.4, minor change, optimize.
    - Not creating new handle in loop.
    __________________
    Do not Private Message @me
    Bacardi is offline
    PabloP
    SourceMod Donor
    Join Date: Feb 2010
    Old 11-08-2011 , 22:12   Re: [Cs:s]Teammate attack show all
    Reply With Quote #9

    thanks for this
    __________________
    Beware, Im a dummy
    PabloP is offline
    kills
    AlliedModders Donor
    Join Date: Sep 2008
    Location: ROU
    Old 09-12-2015 , 17:57   Re: [Cs:s]Teammate attack show all
    Reply With Quote #10

    It can be updated for csgo?

    thank you !
    kills 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 10:12.


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