General > Off-Topic

Chat Tags

(1/1)

strategos:
Do you know of a release or plugin that works with the SVN and adds a tag to a player's chat? example: [chat-tag-here] Strategos: Talk text here.

JamminR:
Similar discussion.
http://forums.ulyssesmod.net/index.php/topic,5365.0.html
Links to a download that is not ULX group related, no idea if it works with ULX.

strategos:
It doesn't. I managed to find some code though that is better. It's easy to convert the (IsAdmin) to ply:IsUserGroup()
However, since i'm running an RP server, the chat functions differently and it ends up duplicating the text like it was sandbox but with the tag only appears on the second 1.

Example:

               (OOC) Strategos: test
               [Owner] Strategos: test

Below, is the raw, unedited code (thanks to "science" for releasing it!)


--- Quote ---if SERVER then
    hook.Add( "PlayerSay", "Tags", function(ply, text, team)
        local rank
        if ply:IsSuperAdmin() then
            rank = "Superadmin"
        elseif ply:IsAdmin() then
            rank = "Admin"
        else
            rank = "User"
        end
        umsg.Start("_Tagsay")
            umsg.String(text)
            umsg.String(rank)
            umsg.Entity(ply)
        umsg.End()
    return false
    end)
 
end
 
if CLIENT then
    usermessage.Hook("_Tagsay", function (um)
        local text = um:ReadString()
        local rank = um:ReadString() or "User"
        local ply = um:ReadEntity()
        if !rank or !text or !ply then return end
        ChatAdd(rank,text, ply)
    end)
 
    function ChatAdd(rank, text, ply)
        chat.AddText("",Color(255,125,0),"[",Color(125,0,0),rank,Color(255,125,0),"] ",Color(0,125,25),ply:Nick()..": ",Color(255,255,255),text)
    end
--- End quote ---

Maybe you guys would know how to make it affective in /ooc chat (and all) and stop it from duplicating.

strategos:
EDITED BECAUSE PEOPLE KEEP STEALING IT!

Navigation

[0] Message Index

Go to full version