Thread: [Solved] [REQ - TF2]Team name colored
View Single Post
Mayor Gamer
Senior Member
Join Date: Nov 2012
Location: GetLocationOfUser(me);
Old 08-20-2016 , 10:00   Re: [REQ - TF2]Team name colored
Reply With Quote #4

Quote:
Originally Posted by Walgrim View Post
Ok so first, thank you for your reply !
So I tried to compile what you said and I get this :

Code:
// namecolorteam.sp(25) : error 029: invalid expression, assumed zero
// namecolorteam.sp(25) : error 029: invalid expression, assumed zero
// namecolorteam.sp(25) : error 017: undefined symbol "CCFF"
// namecolorteam.sp(25) : fatal error 189: too many error messages on one line
So I used like in morecolors to see because I like trying things, I get this :
Code:
if (CGetTeamColor(client) == 0x99CCFF)
	{
		CPrintToChatEx(client, client, "{steelblue}%s {default}: %s", sClientName, sMessage)
	}
	else if (CGetTeamColor(client) == 0xFF4040)
	{
		CPrintToChatEx(client, client, "{brown}%s {default}: %s", sClientName, sMessage)
	}
}
So the problems I get in using my code from the time I tried and now, are :
CPrintToChat just print to chat so players can't use (TEAM) canal.

I'm using custom chat colors so the problem is this :
http://puu.sh/qHMwI/42c03660c3.jpg
I tried something with the admin flag root without success (as far as I remember).

The third one is, when I'm dead it's printing like this : Walgrim : blabla
(I think there's something to do with player_death or something but i don't know how to use that).

EDIT : I used return Plugin_Handled because it's replacing the username, Plugin_Handled don't show the chat as you said but it shows the CPrintToChat, now it's printing 2 messages from me without it. (It's like in the picture).
Use the return Plugin_Handled at the end of the command listener callback so it doesn't print the original chat command and prints the custom message with colors. That should work, if the colors are applying correctly as you planned you should be free to go.
__________________
Mayor Gamer is offline