Jump to content

Colored nametags?


Mossy

Recommended Posts

Hey all. I searched the first page to see if someone else asked this but I didn't find anything. Anyways, I'm trying to get the players' HEX colors to work in their nametags.

--Draw our text 
                    local r,g,b = 255,255,255 
                    local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 
                    dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(255,255,255,textalpha), textscale*NAMETAG_TEXTSIZE, "bankgothic", "center", "bottom", false, false, true, true ) 

This part of the script isn't working. It changes the font to bankgothic but it still shows white for people with HEX colors in their names. Any help? Thanks.

Link to comment
hmmm, it should work, because everything looks perfect...

Maybe it's the HEX name, try outputting the player's name before drawing it.

I have tried that but the output was still white names. If you want I can send more of the script.

Link to comment

For me, it doesn't show the name... I think it's a bug...

Here's what I got:

addEventHandler("onClientPreRender",root,function() 
    dxDrawText ( "#008000 HI", 0, 0, 0, 0, tocolor(255,255,255,255), 1, "default", "left", "top", false, false, false, true, false) 
    dxDrawText ( "#008000 HI", 0, 20, 0, 0, tocolor(255,255,255,255), 1, "default", "left", "top", false, false, true, true, false) 
    dxDrawText ( getPlayerName(localPlayer), 100, 100, 0, 0, tocolor(255,255,255,255), 1, "bankgothic", "center", "bottom", false, false, true, true, false) 
end) 

My name: #008000Jaysds1

EDIT1: After changing "bottom" to "top", it started showing, and it still shows white

EDIT2: It ended up changing colors...

Code:

addEventHandler("onClientPreRender",root,function() 
    dxDrawText ( "#008000 HI", 0, 0, 0, 0, tocolor(255,255,255,255), 1, "default", "left", "top", false, false, false, true, false) 
    dxDrawText ( "#008000 HI", 0, 20, 0, 0, tocolor(255,255,255,255), 1, "default", "left", "top", false, false, true, true, false) 
    dxDrawText ( getPlayerName(localPlayer), 0, 40, 0, 0, tocolor(255,255,255,255), 1, "default", "center", "top", false, false, true, true, false) 
    dxDrawText ( getPlayerName(localPlayer), 0, 60, 0, 0, tocolor(255,255,255,255), 1, "bankgothic", "left", "top", false, false, true, true, false) 
    dxDrawText ( getPlayerName(localPlayer), 0, 80, 0, 0, tocolor(255,255,255,255), 1, "bankgothic", "center", "top", false, false, true, true, false) 
end) 

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