Samy_Romafia Posted December 24, 2011 Share Posted December 24, 2011 Which is the name of color resource, i seached to all resources but i dont find the good resource for show the player name colour, Like this but coloured: Link to comment
Castillo Posted December 24, 2011 Share Posted December 24, 2011 There's no resource to do that, you must edit the race nametags. Link to comment
Cadu12 Posted December 24, 2011 Share Posted December 24, 2011 You have to edit 'nametags.lua' in race resource. Link to comment
Samy_Romafia Posted December 25, 2011 Author Share Posted December 25, 2011 What i need to edit? Link to comment
Evil-Cod3r Posted December 25, 2011 Share Posted December 25, 2011 yes there is local x, y = guiGetScreenSize() function PlayerNameTags() local players = getElementsByType("player") for k,v in ipairs(players) do if v == getLocalPlayer() then else local r = getElementData(v,"red") local g = getElementData(v,"green") local b = getElementData(v,"blue") local x1,y1,z1 = getElementPosition (getLocalPlayer()) local x2,y2,z2 = getElementPosition (v) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto > 75 then else local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+1.05 ) if not sx and not sy then else dxDrawText ( string.gsub ( getPlayerName ( v ), "#%x%x%x%x%x%x", "" ).."", sx,sy,sx,sy, tocolor(r,g,b,255), 1.8-visibleto/50, "default-bold", "center","top",false,false,false ) if y/102-visibleto/5 < 0 then else dxDrawRectangle ( sx-x/13/2+visibleto/2, sy+y/27.2-visibleto/3, x/13-visibleto,y/102-visibleto/10, tocolor(0,0,0,255) ) dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14-visibleto,y/146.3-visibleto/10, tocolor(100,0,0,245) ) if getElementHealth(v) < 1 then else dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14*getElementHealth(v)/100-visibleto,y/146.3-visibleto/10, tocolor(190,0,0,245) ) end local armor = getPedArmor(v) if armor and armor > 0 then dxDrawRectangle ( sx-x/13/2+visibleto/2, sy+y/40.2-visibleto/3, x/13-visibleto,y/102-visibleto/10, tocolor(0,0,0,255) ) dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/38-visibleto/3, x/14-visibleto,y/146.3-visibleto/10, tocolor(100,100,100,245) ) dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/38-visibleto/3, x/14*armor/100-visibleto,y/146.3-visibleto/10, tocolor(190,190,190,245) ) end end end end end end end addEventHandler("onClientRender",getRootElement(),PlayerNameTags) Link to comment
arezu Posted December 26, 2011 Share Posted December 26, 2011 yes there is local x, y = guiGetScreenSize() function PlayerNameTags() local players = getElementsByType("player") for k,v in ipairs(players) do if v == getLocalPlayer() then else local r = getElementData(v,"red") local g = getElementData(v,"green") local b = getElementData(v,"blue") local x1,y1,z1 = getElementPosition (getLocalPlayer()) local x2,y2,z2 = getElementPosition (v) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto > 75 then else local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+1.05 ) if not sx and not sy then else dxDrawText ( string.gsub ( getPlayerName ( v ), "#%x%x%x%x%x%x", "" ).."", sx,sy,sx,sy, tocolor(r,g,b,255), 1.8-visibleto/50, "default-bold", "center","top",false,false,false ) if y/102-visibleto/5 < 0 then else dxDrawRectangle ( sx-x/13/2+visibleto/2, sy+y/27.2-visibleto/3, x/13-visibleto,y/102-visibleto/10, tocolor(0,0,0,255) ) dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14-visibleto,y/146.3-visibleto/10, tocolor(100,0,0,245) ) if getElementHealth(v) < 1 then else dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14*getElementHealth(v)/100-visibleto,y/146.3-visibleto/10, tocolor(190,0,0,245) ) end local armor = getPedArmor(v) if armor and armor > 0 then dxDrawRectangle ( sx-x/13/2+visibleto/2, sy+y/40.2-visibleto/3, x/13-visibleto,y/102-visibleto/10, tocolor(0,0,0,255) ) dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/38-visibleto/3, x/14-visibleto,y/146.3-visibleto/10, tocolor(100,100,100,245) ) dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/38-visibleto/3, x/14*armor/100-visibleto,y/146.3-visibleto/10, tocolor(190,190,190,245) ) end end end end end end end addEventHandler("onClientRender",getRootElement(),PlayerNameTags) I think he means nametags that shows hexadecimal colors. ... here i uploaded my custom dxDrawText function that supports hexadecimal colors: https://community.multitheftauto.com/index.php?p= ... ls&id=3421 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