'LinKin Posted April 5, 2014 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. Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
xXMADEXx Posted April 5, 2014 Posted April 5, 2014 You can try to use string.sub. The Ultimate Lua Tutorial! | MTA PHP SDK
Jacobob14 Posted April 5, 2014 Posted April 5, 2014 you have to edit the arguments of dxDrawText to accept hexadecimal codes
'LinKin Posted April 5, 2014 Author Posted April 5, 2014 Yes.. I did that @Jacob. @Madex. What do u mean? Isn't that for removing the colour codes? Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Moderators Citizen Posted April 6, 2014 Moderators 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 The rEvolution is coming ...
'LinKin Posted April 6, 2014 Author 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 Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Moderators Citizen Posted April 6, 2014 Moderators 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 ?) The rEvolution is coming ...
Cadu12 Posted April 6, 2014 Posted April 6, 2014 Race modified function "getPlayerName" to remove codes, use "_getPlayerName" Ingame nick: Cadu12
Moderators Citizen Posted April 6, 2014 Moderators Posted April 6, 2014 Race modified function "getPlayerName" to remove codes, use "_getPlayerName" oh, yeah you are totally right. I forgot about that (again ? ) The rEvolution is coming ...
'LinKin Posted April 6, 2014 Author Posted April 6, 2014 Race modified function "getPlayerName" to remove codes, use "_getPlayerName" Thanks. It works Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Cadu12 Posted April 6, 2014 Posted April 6, 2014 Citizen . Linkin, You're welcome. Ingame nick: Cadu12
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