Jump to content

GUI Label Colorcodes


drk

Recommended Posts

I'm trying to create a gui label and use color codes in the label.

I tried editing guiCreateColorLabel ( you can find it on forum ) but it don't work. It appear without color codes but no colors :S

Anyone knows a way to put color codes in a label and the colors appear?

Link to comment
I've tested that function before and it worked, maybe your text doesn't has HEX colors?

Sorry for replying the post again...

I tried guiCreateColorLabel function from the forum and It don't work. It only display the first colored text.

The only one who works is dxDrawColorText.

Maybe I will need to create my custom functions :S

Link to comment

replace the getPlayerName in_comon.lua whit this

and if you ask in race gamemode getPlayerName(player) then it return whitout hex colors if you ask getPlayerName(player,"hex") then it will return the name whit hex color's

function removeColorCoding ( name ) 
    return type(name)=='string' and string.gsub ( name, '#%x%x%x%x%x%x', '' ) or name 
end 
  
_getPlayerName = getPlayerName 
function getPlayerName ( player,hex ) 
if hex then 
return  _getPlayerName ( player ) 
else 
    return removeColorCoding ( _getPlayerName ( player ) ) 
end 
end 

Link to comment
Problem already solved. I write him function.

Yeah, and the problem isn't Race mode.

replace the getPlayerName in_comon.lua whit this

and if you ask in race gamemode getPlayerName(player) then it return whitout hex colors if you ask getPlayerName(player,"hex") then it will return the name whit hex color's

Problem isn't there, and it isn't getPlayerName ( player, 'hex' ), it's getPlayerName ( player, boolHex ).

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