I made a chat for my TTT server but color is wrong
2 replies, posted
Heres my code
[QUOTE]if SERVER then
AddCSLuaFile( "tags.lua" )
end
local cOwner = Color( 255, 255, 255 )
local cSAdmin = Color( 0, 255, 255 )
local cAdmin = Color( 0, 255, 0 )
local cTrusted = Color( 223, 101, 247 )
local cRapeTrain = Color( 63, 63, 170 )
local cMod = Color( 255, 255, 0 )
local cCoOwner = Color( 255, 255, 255 )
local cHAdmin = Color( 255, 0, 0 )
local cMember = Color( 0, 0, 255 )
local cVIP = Color( 0, 187, 255 )
local cGuest = Color( 94, 94, 94 )
local cDefault = Color( 94, 94, 94 )
local cAssFace = Color( 130, 28, 28 )
local cRegular = Color ( 175, 175, 142 )
local cDeveloper = Color ( 255, 0, 233 )
local CTags = {}
-- CTags[Number] = { "Tag of group", "group-name", Color( of, the, tag ) }
CTags[1] = { "Owner", "owner", cOwner }
CTags[2] = { "Super Admin", "s.admin", cSAdmin }
CTags[3] = { "Trusted", "trusted", cTrusted }
CTags[4] = { "Admin", "admin", cAdmin }
CTags[5] = { "Moderator", "moderator", cMod }
CTags[6] = { "Co-Owner", "co-owner", cCoOwner }
CTags[7] = { "Head Admin", "h.admin", cHAdmin }
CTags[8] = { "Member", "member", cMember }
CTags[9] = { "VIP", "vip", cVIP }
CTags[10] = { "Guest", "default", cDefault }
CTags[11] = { "Guest", "user", cGuest }
CTags[12] = { "AssFace", "assface", cAssFace }
CTags[13] = { "Regular", "regular", cRegular }
CTags[14] = { "Developer", "developer", cDeveloper }
CTags[15] = { "RapeTrain", "rapetrain", cRapeTrain }
local function ChatTags( a, b, c, d )
local C = {}
if d then
table.insert( C, Color( 255, 30, 40 ) )
table.insert( C, "*DEAD* " )
end
if c then
table.insert( C, Color( 30, 160, 40 ) )
table.insert( C, "(TEAM) " )
end
if a:IsValid() then
for _,v in pairs( CTags ) do
if a:IsUserGroup( v[2] ) then
table.insert( C, cWhite )
table.insert( C, "[" )
table.insert( C, v[3] )
table.insert( C, v[1] )
table.insert( C, cWhite )
table.insert( C, "] " )
break
end
end
table.insert( C, team.GetColor( a:Team() ) )
table.insert( C, a:Nick() )
else
table.insert( C, "Console" )
end
table.insert( C, Color( 255, 255, 255 ) )
table.insert( C, ": "..b )
chat.AddText( unpack( C ) )
return true
end
hook.Add( "OnPlayerChat", "___ChatTags", ChatTags )[/QUOTE]
It works fine its just when I type in chat it will make the first bracket ( "[" ) a light blue but then the rest is white, it does it with all of the groups. Say your Trusted the bracket will be a light blue but the rest will be pink :/ It does it with Team chat and Dead chat.
Any suggestions?
Thanks Karp.
You did not make this some other dude made it on Face Punch....
also is it in lua/autorun/server?
or in lua/autorun?
I can't remember were to put it.
Yes its in autorun/server, I said its working fine its just making the colors weird
Sorry, you need to Log In to post a reply to this thread.