-- Client Side
-- Originally Made By: TyGuy
-- Edited By: Mr. Apple
-- Further edits by: Bytewave
local Tags =
{
-- Do not add []s here.
--Group --Tag --Color
{"admin", "Admin", Color(0, 0, 255, 255) },
{"superadmin", "SUPERADMIN", Color(255, 0, 0, 255) },
{"owner", "Owner", Color(255, 0, 0, 255) },
}
hook.Add("OnPlayerChat", "apple_chat_tags_OnPlayerChat_hook", function(ply, Text, Team, PlayerIsDead)
if ply:IsValid() then
for k,v in pairs(Tags) do
if ply:IsUserGroup(v[1]) then
if Team then
if ply:Alive() then
chat.AddText(Color(0, 204, 0, 255), "{TEAM} ", color_white, "[", v[3], v[2], color_white, "]", Color(50, 50, 50, 255), " ", team.GetColor(ply:Team()), ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
else
chat.AddText(Color(255, 0, 0, 255), "*DEAD*", Color(0, 204, 0, 255), "{TEAM} ", color_white, "[", v[3], v[2], color_white, "]", Color(50, 50, 50, 255), " ", team.GetColor(ply:Team()), ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
end
return true
end
if ply:IsPlayer() then
if ply:Alive() then
chat.AddText(Color(255, 0, 0, 255), "", color_white, "[", v[3], v[2], color_white, "]", Color(50, 50, 50, 255), " ", team.GetColor(ply:Team()), ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
return true
elseif !ply:Alive() then
chat.AddText(Color(255, 0, 0, 255), "*DEAD* ", color_white, "[", v[3], v[2], color_white, "]", Color(50, 50, 50, 255), " ", team.GetColor(ply:Team()), ply:Nick(), color_white, ": ", Color(255, 255, 255, 255), Text)
return true
end
end
end
end
end
end)