chat tag help

Post Reply
desenex
New to forums
New to forums
Posts: 8
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Jul 20, 2013 11:56 pm

chat tag help

Post by desenex »

Ok so this is what im using for my chat tag.
So everytime i type something it says [super-admin]desenex: hey
desenex:hey

so what i am trying to get rid of is where it says desenex:hey it like repeats itself can someone help?



-- DarkRP ULX Prefixes originally created by Warlock, fixed and recoded by Tabrune and modify by men232.
-- rank_str is the prefix shown before the players name, rank_col and bracket_col are colors obviously (RGB).
if SERVER then
AddCSLuaFile();
return;
end;

local stored = {};
local meta = FindMetaTable( "Player" );
local haveNiceFunc = meta.GetUserGroup != nil;

local function AddPrefix( group, name, color, bracket_col )
if (group and name and color) then
stored[group] = { name = name, color = color, bracket_col = bracket_col };
end;
end;

local function AddToChat(msg)
local col1 = Color(msg:ReadShort(), msg:ReadShort(), msg:ReadShort())

local name = msg:ReadString()
local ply = msg:ReadEntity()
ply = IsValid(ply) and ply or LocalPlayer()

if name == "" or not name then
name = ply:Nick()
name = name ~= "" and name or ply:SteamName()
end

local col2 = Color(msg:ReadShort(), msg:ReadShort(), msg:ReadShort())

local text = msg:ReadString()
local rank_str, rank_col, bracket_col

if (IsValid(ply) and ply:IsPlayer()) then
if (!haveNiceFunc) then
for group, v in pairs(stored) do
if (ply:IsUserGroup(group)) then
rank_str = v.name;
rank_col = v.color;
bracket_col = v.bracket_col or v.color;
break;
end;
end;
else
local group = ply:GetUserGroup();
local v = stored[group];
if (v) then
rank_str = v.name;
rank_col = v.color;
bracket_col = v.bracket_col or v.color;
else
rank_str = "";
rank_col = Color( 255, 255, 255 );
end;
end;
else
rank_str = "";
rank_col = Color( 255, 255, 255 );
end;

if text and text ~= "" then
chat.AddText(bracket_col, bracket_col and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", col1, name, col2, ": "..text)
if IsValid(ply) then
hook.Call("OnPlayerChat", nil, ply, text, false, not ply:Alive())
end
else
chat.AddText(col1, name)
hook.Call("ChatText", nil, "0", name, name, "none")
end
chat.PlaySound()
end

timer.Simple(1, function()
usermessage.Hook("DarkRP_Chat", AddToChat);
end);

-- Add Prefixes (group, print name, rank color, bracket color).
AddPrefix( "owner", "Owner", Color(0, 0, 232), Color(0, 0, 232) );
AddPrefix( "developer", "DEV", Color(0, 0, 0), Color(0, 0, 0) );
AddPrefix( "superadmin", "Super-Admin", Color(232, 0, 0), Color(232, 0, 0) );
AddPrefix( "admin", "Admin", Color(25, 25, 112), Color(25, 25, 112) );
AddPrefix( "moderator", "Mod", Color(0, 101, 0), Color(0, 101, 0) );
AddPrefix( "donor", "Donor", Color(245 ,222 ,179), Color(245 ,222 ,179) );
AddPrefix( "golddonor", "Gold", Color(255, 215, 0), Color(255, 215, 0) );
AddPrefix( "silverdonor", "Silver", Color(128, 128, 128), Color(255, 215, 0) );
AddPrefix( "respected", "VIP", Color(219, 169, 18), Color(219, 169, 18) );
AddPrefix( "user", "Player", Color(255, 255, 255), Color(255, 255, 255) );
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: chat tag help

Post by Sir Nipah »

Your better off taking this to facepunch I don't know enough lua to fix this and I don't think anyone here will help you either.
Image Garry's Mod veteran.
Post Reply