Author Topic: Prefixes messed up, need help!  (Read 2273 times)

0 Members and 1 Guest are viewing this topic.

Offline Janjakob2000

  • Jr. Member
  • **
  • Posts: 65
  • Karma: 0
Prefixes messed up, need help!
« on: March 12, 2015, 11:47:56 AM »
So I am using a few addons for my server like a prefix addon wich uses this code
Code: [Select]
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
{"user", "[User] ", Color(212, 67, 255, 255) },
{"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 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())
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
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 )
So I tryed adding a prefix for a different group, then it would like something like this right?
Code: [Select]
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
{"user", "[User] ", Color(212, 67, 255, 255) },
{"member", "[MEMBER] ", Color(20, 175, 66, 255) },
{"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 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())
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
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 )
Now I go on my server, set myself to this rank, and it doesn't shows up. (the prefix doesn't  show up)
Any help on how to fix this?
« Last Edit: March 12, 2015, 12:21:12 PM by Janjakob2000 »

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Prefixes messed up, need help!
« Reply #1 on: March 12, 2015, 02:46:45 PM »
Did you restart?
Once you get to know me, you'll find you'll have never met me at all.

Offline Janjakob2000

  • Jr. Member
  • **
  • Posts: 65
  • Karma: 0
Re: Prefixes messed up, need help!
« Reply #2 on: March 13, 2015, 02:31:56 AM »
Like a thousand times.

Offline lynx

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 15
Re: Prefixes messed up, need help!
« Reply #3 on: March 13, 2015, 02:44:25 AM »
Do the other tags work? (admin, superadmin, owner)

Offline Janjakob2000

  • Jr. Member
  • **
  • Posts: 65
  • Karma: 0
Re: Prefixes messed up, need help!
« Reply #4 on: March 13, 2015, 03:09:50 AM »
Yes they do, they work just fine.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Prefixes messed up, need help!
« Reply #5 on: March 13, 2015, 06:06:35 AM »
Yes they do, they work just fine.
While you're connected to your srever, from game or server console, do a "ulx who" - that will list all connected players and the group they are in - does it show you as "owner" group. Case sensitive. Can't be "Owner" or another group, would have to be "owner".
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Janjakob2000

  • Jr. Member
  • **
  • Posts: 65
  • Karma: 0
Re: Prefixes messed up, need help!
« Reply #6 on: March 13, 2015, 06:35:37 AM »
Yes I have checked my spelling and all that stuff, I set myself to member and it does not have a prefix or something like it.