• Colored Chat Text in TTT
    3 replies, posted
[CODE]local role_color = { }; role_color[ROLE_TRAITOR] = Color( 255, 0, 0, 255 ); role_color[ROLE_INNOCENT] = Color( 0, 255, 0, 255 ); role_color[ROLE_DETECTIVE] = Color( 0, 0, 255, 255 ); local function NotifyPlayer(ply, killer) local num = RolePoints[killer:GetRole()][ply:GetRole()] local color = role_color[killer:GetRole()] local bool = string.find(num, "-") if bool then killer:PrintMessage(HUD_PRINTTALK, "You had "..num.." points taken away for killing ".. color .. ply:Nick()..", they were a(n) ".. ply:GetRoleString()..".") else killer:PrintMessage(HUD_PRINTTALK, "You were awarded "..num.." points for killing ".. color .. ply:Nick()..", they were a(n) ".. ply:GetRoleString()..".") end killer:PS_GivePoints(num) end [/CODE] I'm trying to make colored message about nick and role player whose you killed. But this doesn't work(Yes im noob coder)
UP
If you want colored chat messages, you have to use chat.AddText(). The problem is that it's a clientside only function, so you are going to have to network it. Also you should ask this in developer discussion.
oh sorry i'm so blind
Sorry, you need to Log In to post a reply to this thread.