Hello today I would like to know if it's possible to make a command to hide your rank (Ulx) for example
Fake Chat:
[Superadmin] ❤Yui-MHCP001❤ : Hello
(The does !hiderank command)
❤Yui-MHCP001❤ : Hello
This is the code i use for the tags
cl_chattext.lua
[CODE]--Chat Tags by Tyguy
CreateClientConVar("chat_tags_color_r", 255, true, false)
CreateClientConVar("chat_tags_color_g", 255, true, false)
CreateClientConVar("chat_tags_color_b", 255, true, false)
CreateClientConVar("chat_tags_color_a", 255, true, false)
local Tags =
{
--Group --Tag --Color
{"admin", "[Admin] ", Color(0, 0, 255, 255) },
{"superadmin", "[Superadmin] ", Color(255, 0, 0, 255) },
{"moderator", "[Mod] ", Color(0, 255, 0, 255) },
{"Silver Vip", "[Silver Vip] ", Color(112, 110, 110, 255) },
{"Gold Vip", "[Gold Vip] ", Color(255, 255, 51, 255) },
{"Diamond Vip", "[Diamond Vip] ", Color(51, 181, 255, 255) }
}
hook.Add("OnPlayerChat", "Tags", function(ply, strText)
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())
chat.AddText(v[3], v[2], nickteam, ply:Nick(), color_white, ": ", Color(R, G, B, A), strText)
return true
end
end
end )
net.Receive("chattext_msg", function (len)
local msgs = {}
while true do
local i = net.ReadUInt(8)
if i == 0 then break end
local str = net.ReadString()
local col = net.ReadVector()
table.insert(msgs, Color(col.x, col.y, col.z))
table.insert(msgs, str)
end
chat.AddText(unpack(msgs))
end)
[/CODE]
sv_chattext.lua
[CODE]--Chat Tags by Tyguy
CreateClientConVar("chat_tags_color_r", 255, true, false)
CreateClientConVar("chat_tags_color_g", 255, true, false)
CreateClientConVar("chat_tags_color_b", 255, true, false)
CreateClientConVar("chat_tags_color_a", 255, true, false)
local Tags =
{
--Group --Tag --Color
{"admin", "[Admin] ", Color(0, 0, 255, 255) },
{"superadmin", "[Superadmin] ", Color(255, 0, 0, 255) },
{"moderator", "[Mod] ", Color(0, 255, 0, 255) },
{"Silver Vip", "[Silver Vip] ", Color(112, 110, 110, 255) },
{"Gold Vip", "[Gold Vip] ", Color(255, 255, 51, 255) },
{"Diamond Vip", "[Diamond Vip] ", Color(51, 181, 255, 255) }
}
hook.Add("OnPlayerChat", "Tags", function(ply, strText)
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())
chat.AddText(v[3], v[2], nickteam, ply:Nick(), color_white, ": ", Color(R, G, B, A), strText)
return true
end
end
end )
util.AddNetworkString("chattext_msg")
local meta = {}
meta.__index = meta
function meta:Add(string, color)
local t = {}
t.string = string
t.color = color or color_white
table.insert(self.msgs, t)
return self
end
function meta:SendAll()
self:NetConstructMsg()
net.Broadcast()
return self
end
function meta:Send(ply)
self:NetConstructMsg()
net.Send(ply)
return self
end
function meta:NetConstructMsg()
net.Start("chattext_msg")
for k, msg in pairs(self.msgs) do
net.WriteUInt(1,8)
net.WriteString(msg.string)
net.WriteVector(Vector(msg.color.r, msg.color.g, msg.color.b))
end
net.WriteUInt(0,8)
end
function ChatText()
local t = {}
t.msgs = {}
setmetatable(t, meta)
return t
end
-- local t = ChatText()
-- t:Add("pants down", Color(255,255,255))
-- t:Add(" pants up")
-- t:SendAll()
[/CODE]
And also I would like to know how to stop chat from being red because we only want all text white. example
(Red)[Superadmin](Red) ❤Yui-MHCP001❤ :(Red)Hello(Red)
But we want it like this
(Red)[Superadmin](Red)] ❤Yui-MHCP001❤ :Hello
Everything is possible. But if you want something made, this section is for asking help on scripting, not get something done.
You can go to [url]www.coderhire.com[/url] and post a job, then maybe coders will apply.
But it's a website to get scripter for money.
[QUOTE=lols_cake;42874094]Hello today I would like to know if it's possible to make a command to hide your rank (Ulx)
[/QUOTE]
Yes it is.
/thread.
Sorry, you need to Log In to post a reply to this thread.