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? EPT Team Server Development: 0% Learning C++ | C++ is amazing
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? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
drk Posted March 4, 2012 Author Posted March 4, 2012 I used getPlayerName(source) and it return without colors EPT Team Server Development: 0% Learning C++ | C++ is amazing
Castillo Posted March 4, 2012 Posted March 4, 2012 Are you using this function in race? because race removed HEX colors from getPlayerName. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
drk Posted March 4, 2012 Author Posted March 4, 2012 Ye, it's in Race EPT Team Server Development: 0% Learning C++ | C++ is amazing
Castillo Posted March 4, 2012 Posted March 4, 2012 Try using this: _getPlayerName San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 EPT Team Server Development: 0% Learning C++ | C++ is amazing
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 EPT Team Server Development: 0% Learning C++ | C++ is amazing
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. Ingame nick: Cadu12
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 Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
Kenix Posted March 9, 2012 Posted March 9, 2012 Problem already solved. I write him function. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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 ). EPT Team Server Development: 0% Learning C++ | C++ is amazing
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