[code]local ranks = {
["owner"] = Color(204,0,204),
["superadmin"] = Color(255,0,0),
["vip"] = Color(255,255,51),
["donator"] = Color(0,204,255),
["admin"] = Color(9,255,255),
["operator"] = Color(238,221,130),
["vip+"] = Color(221,255,255),
["developer"] = Color(85,255,255)
}
if (SERVER) then
AddCSLuaFile("chat.lua")
function CustomChat_ChatMessage(ply, msg, rank, r, g, b)
umsg.Start("CustomChat_ChatMsg")
umsg.Entity(ply)
umsg.String(msg)
umsg.String(rank)
umsg.Short(r)
umsg.Short(g)
umsg.Short(b)
umsg.End()
end
function CustomChat_Checker(ply, text, teamonly)
local group = ply:GetUserGroup()
local color = ranks[group]
local txtcheck = string.sub(text,1,1)
if txtcheck == "/" then
return text
else
return "", CustomChat_ChatMessage(ply, text, "["..string.upper(string.sub(group,1,1))..string.sub(group,2).."]", color.r, color.g, color.b)
end
end
hook.Add("PlayerSay", "WordCheck", CustomChat_Checker)
else
usermessage.Hook("CustomChat_ChatMsg", function(um)
local ply = um:ReadEntity()
local msg = um:ReadString()
local rank = um:ReadString()
local r = um:ReadShort()
local g = um:ReadShort()
local b = um:ReadShort()
chat.AddText(Color(r, g, b), rank, team.GetColor(ply:Team()), " "..ply:Nick(), Color(255,255,255), ": "..msg)
end)
end
[/code]
This is what i have but teamchat no longer works for ttt people can see the teamchat someone please help me.
Sorry, you need to Log In to post a reply to this thread.