Jump to content

colored nicknames


Recommended Posts

I don't think you can do this on client-side.

There is a simple example of how I would do it.

local colors = { 
    ["serial1"]={10, 20, 30}, -- red, green, blue 
    ["serial2"]={100, 200, 30} 
} 
  
addEventHandler ( "onPlayerChat", root, 
    function ( message, type ) 
        if type == 0 then 
            cancelEvent () 
            local serial = getPlayerSerial ( source )            
            if colors[ serial ] then 
            local r, g, b = unpack ( colors[ serial ] ) 
                outputChatBox ( getPlayerName( source ) .. "#FFFFFF: " .. message, root, r, g, b, true ) 
            else 
                local r, g, b = getPlayerNametagColor ( source ) 
                outputChatBox ( getPlayerName( source ) .. "#FFFFFF: " .. message, root, r, g, b, true )                 
            end 
        end  
    end ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...