drk Posted March 4, 2012 Posted March 4, 2012 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 Anyone knows a way to put color codes in a label and the colors appear?
Castillo Posted March 4, 2012 Posted March 4, 2012 I've tested that function before and it worked, maybe your text doesn't has HEX colors?
drk Posted March 4, 2012 Author Posted March 4, 2012 I used getPlayerName(source) and it return without colors
Castillo Posted March 4, 2012 Posted March 4, 2012 Are you using this function in race? because race removed HEX colors from getPlayerName.
drk Posted March 4, 2012 Author Posted March 4, 2012 I removed the getPlayerName function that removes hex color from _common.lua I will try now. Anyway Kenix is helping me. I think you can lock this post
drk Posted March 9, 2012 Author Posted March 9, 2012 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
Cadu12 Posted March 9, 2012 Posted March 9, 2012 Its not problem with guiCreateColorLabel, its problem with Race. Just create new folder(resource), im sure it will work.
bandi94 Posted March 9, 2012 Posted March 9, 2012 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
drk Posted March 9, 2012 Author Posted March 9, 2012 Problem already solved. I write him function. Yeah, and the problem isn't Race mode. replace the getPlayerName in_comon.lua whit thisand 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 ).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now