Jump to content

GUI Label Colorcodes


drk

Recommended Posts

Posted

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?

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I used getPlayerName(source) and it return without colors :S

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

Are you using this function in race? because race removed HEX colors from getPlayerName.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Try using this:

_getPlayerName

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 :D

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted
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

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

Its not problem with guiCreateColorLabel, its problem with Race.

Just create new folder(resource), im sure it will work.

Ingame nick: Cadu12

Posted

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 :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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