Thread: [Solved] [REQ - TF2]Team name colored
View Single Post
Author Message
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 08-19-2016 , 17:24   [REQ - TF2]Team name colored
Reply With Quote #1

Hello !
For a while now, I was looking for changing team name colors (I will explain what I'm looking for and what I tried).

So yes, team name colors like when a player is in the blue team, his name is blue and for example I want it in a different color like a different blue name, same case for Red Team and Spectator.

I tried some things with morecolors, without success (sad ), the only things I did is this :

PHP Code:
#include <sourcemod>
#include <morecolors>

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 (
CGetTeamColor(client) == COLOR_BLUE)
    {
      
CPrintToChatEx(clientclient"{steelblue}%s {default}: %s"sClientNamesMessage)
    }
    else if (
CGetTeamColor(client) == COLOR_RED)
    {
      
CPrintToChatEx(clientclient"{brown}%s {default}: %s"sClientNamesMessage)
    }
    return 
Plugin_Handled

I tried to understand simple chat processor in custom chat colors, without success (I am a real begineer) someone can help me/teach me how to do my request?

NB : Sorry if my English is bad

Last edited by Walgrim; 08-30-2016 at 08:44.
Walgrim is offline