'LinKin Posted April 5, 2014 Share Posted April 5, 2014 Hello, Where can I modify the nametags? I want it to draw the player's nick according to the colour codes he has. Example: |SW|Lin#CCCCCCKin (|SW|LinKin) (As SW is an auto-team) At the moment the nick is drawn only with the team's color. But how can I add the other color codes that a player has? I tried changing nametags.lua in Race resource, and I added ,true to the dxDrawText line. But it's still the same Thanks. Link to comment
xXMADEXx Posted April 5, 2014 Share Posted April 5, 2014 You can try to use string.sub. Link to comment
Jacobob14 Posted April 5, 2014 Share Posted April 5, 2014 you have to edit the arguments of dxDrawText to accept hexadecimal codes Link to comment
'LinKin Posted April 5, 2014 Author Share Posted April 5, 2014 Yes.. I did that @Jacob. @Madex. What do u mean? Isn't that for removing the colour codes? Link to comment
Moderators Citizen Posted April 6, 2014 Moderators Share Posted April 6, 2014 (edited) I added ,true to the dxDrawText line. But it's still the same So you tried this ? dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false, true ) (Give it a try again, don't forget to restart the resource to apply to modifications) If it's not working, then try this: r, g, b = 255, 255, 255 dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false, true ) If it's still not working, you are definitly modifying a file that isn't used by the resource you are running (did you extracted race.zip ?) Edited April 6, 2014 by Guest Link to comment
'LinKin Posted April 6, 2014 Author Share Posted April 6, 2014 From nametags.lua inside Race resource: --Draw our text local r,g,b = 255,255,255 local team = getPlayerTeam(player) if team then r,g,b = getTeamColor(team) end local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false, true ) Still the same.. Wierd Link to comment
Moderators Citizen Posted April 6, 2014 Moderators Share Posted April 6, 2014 If it's still not working, you are definitly modifying a file that isn't used by the resource you are running (did you extracted race.zip ?) Link to comment
Cadu12 Posted April 6, 2014 Share Posted April 6, 2014 Race modified function "getPlayerName" to remove codes, use "_getPlayerName" Link to comment
Moderators Citizen Posted April 6, 2014 Moderators Share Posted April 6, 2014 Race modified function "getPlayerName" to remove codes, use "_getPlayerName" oh, yeah you are totally right. I forgot about that (again ? ) Link to comment
'LinKin Posted April 6, 2014 Author Share Posted April 6, 2014 Race modified function "getPlayerName" to remove codes, use "_getPlayerName" Thanks. It works Link to comment
Cadu12 Posted April 6, 2014 Share Posted April 6, 2014 Citizen . Linkin, You're welcome. 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