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(sMessage, sizeof(sMessage));
GetClientName(client, sClientName, sizeof(sClientName));
StripQuotes(sMessage);
if (IsPlayerAlive(client) && CGetTeamColor(client) == 0x99CCFF)
{
CPrintToChatAll("{steelblue}%s {default}: %s", sClientName, sMessage);
}
else if (CGetTeamColor(client) == 0x99CCFF)
{
CPrintToChatAll("*DEAD* {steelblue}%s {default}: %s", sClientName, sMessage);
}
if (IsPlayerAlive(client) && CGetTeamColor(client) == 0xFF4040)
{
CPrintToChatAll("{corrupted}%s {default}: %s", sClientName, sMessage);
}
else if (CGetTeamColor(client) == 0xFF4040)
{
CPrintToChatAll("*DEAD* {corrupted}%s {default}: %s", sClientName, sMessage);
}
else if (CGetTeamColor(client) == 0xCCCCCC)
{
CPrintToChatAll("*SPEC* {dimgray}%s {default}: %s", sClientName, sMessage);
}
return Plugin_Handled
}
__________________