Mossy Posted April 22, 2013 Share Posted April 22, 2013 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
Jaysds1 Posted April 22, 2013 Share Posted April 22, 2013 hmmm, it should work, because everything looks perfect... Maybe it's the HEX name, try outputting the player's name before drawing it. Link to comment
Mossy Posted April 22, 2013 Author Share Posted April 22, 2013 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
Jaysds1 Posted April 22, 2013 Share Posted April 22, 2013 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
Pe/\/duluM Posted April 23, 2013 Share Posted April 23, 2013 Are you using this in the race script? Cause then you have to use "_getPlayerName(player)". The getPlayerName function get's changed to "remove the color codes" Link to comment
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