Thread: [Solved] [REQ - TF2]Team name colored
View Single Post
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 08-20-2016 , 15:44   Re: [REQ - TF2]Team name colored
Reply With Quote #6

Ok so I did it for dead players and spectators ones.
Still don't know how I can change names color in the team chat area, someone can help?

EDIT : Problem with admin commands, everyone can see the "/"

I actually did this for the moment :
PHP Code:
#include <sourcemod>
#include <morecolors>

public Plugin myinfo =
{
    
name "[TF2] Change Team Chat Colors",
    
url "https://forums.alliedmods.net/showthread.php?t=286558"
};

public 
OnPluginStart()
{
    
AddCommandListener(ChatTriggers"say");
    
AddCommandListener(ChatTriggers"say_team");
}

public 
Action ChatTriggers(int client, const String:command[], int argc)
{
    
decl String:sMessage[255];
    
decl String:sClientName[64];

    
GetCmdArgString(sMessagesizeof(sMessage));
    
GetClientName(clientsClientNamesizeof(sClientName));
    
StripQuotes(sMessage);

    if (
IsPlayerAlive(client) && CGetTeamColor(client) == 0x99CCFF)
    {
        
CPrintToChatAll("{steelblue}%s {default}: %s"sClientNamesMessage);
    }
    else if (
CGetTeamColor(client) == 0x99CCFF)
    {
        
CPrintToChatAll("*DEAD* {steelblue}%s {default}: %s"sClientNamesMessage);
    }
    if (
IsPlayerAlive(client) && CGetTeamColor(client) == 0xFF4040)
    {
        
CPrintToChatAll("{corrupted}%s {default}: %s"sClientNamesMessage);
    }
    else if (
CGetTeamColor(client) == 0xFF4040)
    {
        
CPrintToChatAll("*DEAD* {corrupted}%s {default}: %s"sClientNamesMessage);
    }
    else if (
CGetTeamColor(client) == 0xCCCCCC)
    {
        
CPrintToChatAll("*SPEC* {dimgray}%s {default}: %s"sClientNamesMessage);
    }
    return 
Plugin_Handled

__________________

Last edited by Walgrim; 08-20-2016 at 16:46.
Walgrim is offline