ULX

Author Topic: ULX Chat Tags OOC Error  (Read 1423 times)

0 Members and 1 Guest are viewing this topic.

Offline Guydude

  • Newbie
  • *
  • Posts: 1
  • Karma: -1
ULX Chat Tags OOC Error
« on: September 28, 2014, 05:55:09 PM »
So I added these chat tags to my server and the (OOC) doesn't display in front of your name when you speak in ooc. Also the text is black and advert looks like OOC....
Example: http://i.imgur.com/h8nUSyb.jpg

Code: [Select]
CreateClientConVar("chat_tags_color_r", 255, true, false)
CreateClientConVar("chat_tags_color_g", 255, true, false)
CreateClientConVar("chat_tags_color_b", 255, true, false)
CreateClientConVar("chat_tags_color_a", 255, true, false)

local Tags =
{
--Group    --Tag     --Color
{"donator", "[Donator]", Color(255, 233, 0, 255) },
{"modintraining", "[Mod In Training]", Color(255, 233, 0, 255) },
{"Coder", "[Coder] ", Color(40, 42, 40, 255) },
{"trialmod", "[Trial Mod] ", Color(182, 0, 255, 255) },
{"headadmin", "[Trial Admin] ", Color(37, 222, 20, 255) },
{"user", "[User] ", Color(39, 37, 34, 255) },
{"admin", "[Admin] ", Color(255, 153, 0, 255) },
{"superadmin", "[Super Admin] ", Color(0, 0, 255, 255) },
{"Owner", "[Owner] ", Color(0, 242, 255, 255) },
{"Moderator", "[Mod] ", Color(182, 0, 255, 255) }
}

hook.Add("OnPlayerChat", "Tags", function(ply, strText, bTeamOnly)
if IsValid(ply) and ply:IsPlayer() then
for k,v in pairs(Tags) do
if ply:IsUserGroup(v[1]) then
local R = GetConVarNumber("chat_tags_color_r")
local G = GetConVarNumber("chat_tags_color_g")
local B = GetConVarNumber("chat_tags_color_b")
local A = GetConVarNumber("chat_tags_color_a")
local nickteam = team.GetColor(ply:Team())
if !bTeamOnly then
chat.AddText(v[3], v[2], nickteam, ply:Nick(), color_white, ": ", Color(R, G, B, A), strText)
return true
else
chat.AddText(v[3], v[2], nickteam, "(TEAM) ", ply:Nick(), color_white, ": ", Color(R, G, B, A), strText)
return true
end
end
end
end
if !IsValid(ply) and !ply:IsPlayer() then
local ConsoleColor = Color(0, 255, 0) --Change this to change Console name color
chat.AddText(ConsoleColor, "Console", color_white, ": ", strText)
return true
end
end )
« Last Edit: September 28, 2014, 06:37:07 PM by Guydude »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Chat Tags OOC Error
« Reply #1 on: September 28, 2014, 08:53:11 PM »
You'll likely get better support posting in the chat tags release thread, as this area of the forum is intended for Team Ulysses project questions.
Chat Tags was released by a community member.
« Last Edit: September 28, 2014, 08:55:37 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming