Want *Dead* when player is dead before somebody's player name.
0 replies, posted
I would like to have * Dead * before somebody's name when they are dead. (In chat)
New to coding so don't know how to do this :$
This is my current tag script:
[CODE]--Chat Tags by Tyguy
CreateClientConVar("chat_tags_color_r", 0, true, false)
CreateClientConVar("chat_tags_color_g", 0, true, false)
CreateClientConVar("chat_tags_color_b", 0, true, false)
CreateClientConVar("chat_tags_color_a", 255, true, false)
local Tags =
{
--Group --Tag --Color
{"member", "[Member] ", Color(255, 187, 0, 0) },
{"trial-moderator", "[T-Mod] ", Color(0, 255, 0, 0) },
{"moderator", "[Moderator] ", Color(0, 255, 0, 0) },
{"admin", "[Admin] ", Color(0, 255, 0, 0) },
{"superadmin", "[Super-Admin] ", Color(0, 255, 0, 0) },
{"co-owner", "[CO-Owner] ", Color(0, 255, 0, 0) },
{"owner", "[Owner] ", Color(0, 255, 0, 0) }
}
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())
local status = if ( v:Alive() ) then
if !bTeamOnly then
chat.AddText(v[3], v[2], nickteam, ply:Nick(), color_white, ": ", Color(255, 255, 255, 0), strText)
return true
else
chat.AddText(v[3], v[2], nickteam, "(TEAM) ", ply:Nick(), color_white, ": ", Color(255, 255, 255, 0), 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 )[/CODE]
Can somebody help me?
Thanks,
ThaDealerz
[editline]25th November 2015[/editline]
Figured it out on my self:smile:
[code]
// Client Side
// Originally Made By: TyGuy
// Edited By: CaptainDeagle62
local Tags =
{
--Group --Tag --Color
{"admin", "Admin", Color(0, 0, 255, 255) },
{"superadmin", "SuperAdmin", Color(255, 0, 0, 255) },
{"owner", "Owner", Color(0, 255, 0, 255) },
{"co-owner", "CO-Owner", Color(0, 255, 0, 255) },
{"moderator", "Moderator", Color(100, 100, 0, 200) },
{"t_moderator", "T-Moderator", Color(75,100,255,0) },
}
hook.Add("OnPlayerChat", "Tags", function(ply, Text, Team, PlayerIsDead)
if ply:IsValid() then
local nickteam = team.GetColor(ply:Team())
for k,v in pairs(Tags) do
if ply:IsUserGroup(v[1]) then
if Team then
if ply:Alive() then
chat.AddText(nickteam ,"{TEAM} ", v[3],"[", v[2], "] ", v[3],nickteam, ply:Nick(), ": ", Color(255, 255, 255, 255), Text)
else
chat.AddText(nickteam ,"*Dead* ", "{TEAM} ", v[3], "[", v[2], "] ", v[3],nickteam, ply:Nick(), ": ", Color(255, 255, 255, 255), Text)
end
return true
end
if ply:IsPlayer() then
if ply:Alive() then
chat.AddText(nickteam, "", v[3],"[", v[2], "] ", v[3],nickteam, ply:Nick(), ": ", Color(255, 255, 255, 255), Text)
return true
elseif !ply:Alive() then
chat.AddText(nickteam, "*Dead* ", v[3],"[", v[2], "] ", v[3],nickteam, ply:Nick(), ": ", Color(255, 255, 255, 255), Text)
return true
end
end
end
end
end
end)
[/code]
Sorry, you need to Log In to post a reply to this thread.