-- free chat tags by rejax
-- dont need to edit core files you lazy bum
local Tags = {}
Tags["superadmin"] = { Color( 255, 60, 50 ), "SuperAdmin", Color( 255, 60, 50 ) }
Tags["admin"] = { Color( 200, 90, 80 ), "Admin", Color( 200, 100, 100 ) }
Tags["vip"] = { Color( 50, 210, 50 ), "VIP", Color( 50, 255, 50 ) }
local function AddChatTags( ply, msg, team, dead )
if ply:Alive() then
return false else
if GAMEMODE.FolderName == "murder" then
local text = {}
local tag = Tags[ply:GetNWString("usergroup")]
if tag then
table.insert( text, tag[3] )
table.insert( text, "[" )
table.insert( text, tag[1] )
table.insert( text, tag[2] )
table.insert( text, tag[3] )
table.insert( text, "] " )
end
table.insert( text, ply:GetPlayerColor() ) -- i think this returns a vector so find a way to convert it to rgb
table.insert( text, ply:Nick() )
table.insert( text, color_white )
table.insert( text, ": " .. msg )
chat.AddText( unpack( text ) )
return true
end
end
end
hook.Add( "OnPlayerChat", "ChatTags", AddChatTags )
The tags wont show, i have apromote so maybe its that? thanks for the help if any of you can help but i need the tags to show up they dont show up
Jedi Knight James: Test
[editline]22nd December 2016[/editline]
any help?
Use Lua tags please.
If this is for starwarsrp, why are you checking for Murder?
were do i find lua tags?
[QUOTE=Greenpanda45;51569539]were do i find lua tags?[/QUOTE]
Wrap your text/code in [code.] [/code.] tags (without the dot)
[QUOTE=Greenpanda45;51569539]were do i find lua tags?[/QUOTE]
Need сhat ags? By Tyguy
[code]
CreateClientConVar("chat_tags_color_r", 255, 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 =
{
{"admin", "[Admin]", Color(0, 0, 255, 255) },
{"superadmin", "[Superadmin] ", Color(255, 0, 0, 255) },
{"owner", "[Owner] ", Color(0, 255, 0, 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 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
end )
[/code]
Sorry, you need to Log In to post a reply to this thread.