ULX Chattags

Hallo guys i just find a new chat tags script you need ULX admin mod installed.
put this lua script in your cl_init.lua made for all gamemodes:rock:

For more info add me on steam


need help please type over steam


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

	local name = msg:ReadString()
	local ply = msg:ReadEntity()

	if name == "" then name = ply.DarkRPVars.rpname end

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

local text = msg:ReadString()
	local rank_str, rank_col, bracket_col
	if ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("owner") then
        rank_str = "Server owner"
        rank_col = Color( 205, 92, 92 )
        bracket_col = Color( 200, 205, 50)
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("headadmin") then
        rank_str = "HeadAdmin"
        rank_col = Color( 0, 0, 160 )
        bracket_col = Color( 50, 205, 50 )	
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("moderator") then
        rank_str = "Mod"
        rank_col = Color( 51, 204, 255 )
        bracket_col = Color( 50, 205, 50 )
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("respected") then
        rank_str = "Respected"
        rank_col = Color( 51, 204, 255 )
        bracket_col = Color( 50, 205, 50 )
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("superadmin") then
        rank_str = "SA"
        rank_col = Color( 255, 69, 0 )
        bracket_col = Color( 50, 205, 50 )
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("admin") then
        rank_str = "Admin"
        rank_col = Color( 128, 255, 0 )
        bracket_col = Color( 50, 205, 50 )
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("vip") then
        rank_str = "VIP"
        rank_col = Color( 51, 204, 255 )
        bracket_col = Color( 50, 205, 50  )
    elseif ply:IsValid() and ply:IsPlayer() and ply:IsUserGroup("user") then
        rank_str = "User"
        rank_col = Color( 128, 255, 0 )
        bracket_col = Color( 50, 205, 50 )
    else
        rank_str = ""
        rank_col = Color( 255, 255, 255 )
    end
    if text and text ~= "" then
        chat.AddText(col1, name, bracket_col, bracket_col  and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", col2, ": "..text)
    end

    chat.PlaySound()
end
usermessage.Hook( "DarkRP_Chat", AddToChat )


You really need to stop posting other peoples scripts.

This has been posted on this forum before.

nope just made it today

This says otherwise. both scripts are pretty much the same but a little change.

how do i block you

Something to hide?

just post a thread in GD titled “ban me”

then no one will every talk to you on FP again

[lua]
usermessage.Hook( “DarkRP_Chat”, AddToChat )
[/lua]
Are you sure about that? ALL gamemodes?

He didn’t make it himself, he probably doesn’t know lua at all.

Oh god, please… Stop with all this fighting. :
Lock this thread.

Make your mind up if you made it or not.
Oh, and this is yours too? haha.

Let’s all add him and ask him for help since he obviously made this, he’ll know all about it.

I added him a few hours ago, he told me to shut up. Clearly doesn’t know how to work his own release.

on a sidenote, what is the standard usermessage.Hook for gmod chatbox? I wanted to code something like this not long ago, but couldn’t figure out where player messages/chatbox were handled.

You’re going to want to use the hook PlayerSay AFAIK.

ah cheers

“The Lua expert”, GabGame7 was suppose to answer that one!

This looks pretty good, I tryed it in-game. It works with FAdmin too. The only thing i noticed was that the titles where after the players name.
other then that it looks pretty good.

GabGame won’t help you here so, if you want them before the name; replace



 chat.AddText(col1, name, bracket_col, bracket_col  and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", col2, ": "..text)


with



 chat.AddText(bracket_col, bracket_col  and " [" or "", rank_col, rank_str, bracket_col, bracket_col and "] " or "", col1, name, col2, ": "..text)


Thanks :smiley: BTW im new to lua so i didnt know how to do it :, but thank you :slight_smile: