Ulysses Stuff > Releases
Player Chat Tags
Bite That Apple:
--- Quote from: datgregofag on February 16, 2013, 05:51:31 AM ---Here ill show you the problem. Its like this
[Owner] Greg: Hello
then i want it to change text and name color for admin but its still the same except the rank changes color
[Admin] Greg: Hello
See how the RANK only changes color but the text and name stays the same.
i will put my script below and if you can change it so that there is a different name and text color for each group ( except guest). TY Just make it any colors and then ill adjust it.
This is CL TAG lua file.
--- Code: ---// Cleint Side apple :p
local Tags =
{
--Group --Tag --Color
{"admin", "Admin ", Color(220, 180, 0, 255) },
{"superadmin", "Owner ", Color(0, 0, 255, 255) },
{"operator", "Operator ", Color(173, 255, 47, 255) },
{"vip", "VIP ", Color(255, 255, 0, 255) },
{"respected", "Respected ", Color(221, 160, 221, 255) },
{"user", "Guest ", Color(255, 255, 255, 255) }
}
hook.Add("OnPlayerChat", "Tags", function(ply, strText)
for k,v in pairs(Tags) do
if ply:IsPlayer() then
if ply:IsUserGroup(v[1]) then
local nickteam = team.GetColor(ply:Team())
// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", Color(255, 255, 0, 255), strText)
return true
end
end
end
end )
--- End code ---
The ranks are only for the ranks but how do i add more text and name colors to each group (except guest).
--- End quote ---
I'm really not understanding what is the problem here. You can already do that, look
// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", Color(255, 255, 0, 255), strText)
What I just colour'd red, is the place you change the text color, and what I colour'd blue is where you can change the name colour.
datgregofag:
Yeah but how do i make each individual rank have their own name and text color.
Bite That Apple:
--- Quote from: datgregofag on February 16, 2013, 03:58:42 PM ---Yeah but how do i make each individual rank have their own name and text color.
--- End quote ---
yeah... i have no clue what you mean now... I've helped you on everything...
datgregofag:
Like admins has a rank color of purple a name color red and text color blue
owner has a rank color of red and name color of yellow and text color green
sort of like that except for all my ranks
i have ranks
owner
admin
operator
VIP
respected
user(i dont want any colors for user)
Bite That Apple:
--- Quote from: datgregofag on February 17, 2013, 04:18:55 PM ---Like admins has a rank color of purple a name color red and text color blue
owner has a rank color of red and name color of yellow and text color green
sort of like that except for all my ranks
i have ranks
owner
admin
operator
VIP
respected
user(i dont want any colors for user)
--- End quote ---
Like I said, you can. You just need to learn the very basic of lua. It's all right there. Everything is setup for you, you just need to change the color yourself.
// Cleint Side apple :p
local Tags =
{
--Group --Tag --Color
{"admin", "Admin ", Color(220, 180, 0, 255), Color(255, 0, 0, 0) },
{"superadmin", "Owner ", Color(0, 0, 255, 255) , Color(255, 0, 0, 0) },
{"operator", "Operator ", Color(173, 255, 47, 255), Color(255, 0, 0, 0) },
{"vip", "VIP ", Color(255, 255, 0, 255), Color(255, 0, 0, 0) },
{"respected", "Respected ", Color(221, 160, 221, 255), Color(255, 0, 0, 0) },
{"user", "Guest ", Color(255, 255, 255, 255), Color(255, 0, 0, 0) }
}
hook.Add("OnPlayerChat", "Tags", function(ply, strText)
for k,v in pairs(Tags) do
if ply:IsPlayer() then
if ply:IsUserGroup(v[1]) then
local nickteam = team.GetColor(ply:Team())
// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", v[4], strText)
return true
end
end
end
end )
Red = Change group color
Green = Change player color
Blue = Change text color
ALSO I'm sorry, but I can't put it in [ code ] tag. If I do the color disappears.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version