Jump to content

More Color Code's Help


Recommended Posts

Some time ago i posted a question for a way to hide the name color codes ( /viewtopic.php?f=91&t=33198 )

But i know i want to if there's a way to USE them..

Like in killmessages and ranking (left of the screen)

(off topic question, in which resource is the /me command :D)

Regards,

John

Link to comment
The /me command is a built-in command, you can cancel it.

Its not for canceling, but editing, its now pink and with the color codes, but i prefer it in our color and with working color codes

getPlayerName(player):gsub('#%x%x%x%x%x%x', '') 

Something like this, but this line deletes the code, and i want something to get the code working^^

Possible or not?

Link to comment

outputChatBox function has a last argument, used color code or not, set it to true, example:

outputChatBox("#FF0000Hello world.",getRootElement(),255,255,255,true) 

Did you meant that?

And for /me with different style, do this:

addEventHandler ( "onPlayerChat", getRootElement(), 
function ( message, messageType ) 
    if messageType == 1 then 
        cancelEvent() 
       outputChatBox("* ".. getPlayerName(source) .. "".. tostring(message),getRootElement(),255,100,0) -- should output in some kind of orange colour. 
    end 
end) 
  

Link to comment

for changing colors of dx texts, for example kill tabs, you need to edit the resources

but if you want to get rgb from hex, its easy

  
local nick=getPlayerName(player) 
local col=nick:match("^#(%x%x%x%x%x%x)" 
local nick=nick:gsub("#%x%x%x%x%x%x","") 
local r,g,b=tonumber("0x"..string.sub(col, 1, 2)), tonumber("0x"..string.sub(col, 3, 4)), tonumber("0x"..string.sub(col, 5, 6)) 
  

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...