xRGamingx Posted February 4, 2018 Share Posted February 4, 2018 How to fade this text while I'm moving away from it? ? function jobL() for k, v in ipairs(getElementsByType("marker")) do local info = getElementData(v, "infojob") if info then local x, y, z = getElementPosition(localPlayer) local mx, my, mz = getElementPosition(v) local a, b = 50, 30 local cx, cy, cz = getCameraMatrix() if getDistanceBetweenPoints3D(x, y, z, mx, my, mz + 0.5) < 65 and isLineOfSightClear(cx, cy, cz, mx, my, mz + 0.5, true, true, false) then local sx, sy = getScreenFromWorldPosition(mx, my, mz + 0.5) if sx and sy then sx, sy = sx - a, sy - b dxDrawText(info, (sx - 30)-1, sy-1, sx-1, sy-1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy-1, sx+1, sy-1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, (sx - 30)-1, sy+1, sx-1, sy+1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy+1, sx+1, sy+1, tocolor(0, 0, 0, 255), 0.6, "bankgothic") dxDrawText(info, sx - 30, sy, sx, sy, tocolor(243, 0, 0, 255), 0.6, "bankgothic") end end end end end addEventHandler("onClientRender", root, jobL) Link to comment
NeXuS™ Posted February 4, 2018 Share Posted February 4, 2018 You have to modify the alpha of it (tocolor(r, g, b, alpha)), depending on the distance, which you can get using getDistanceBetweenPoints3D. Link to comment
xRGamingx Posted February 4, 2018 Author Share Posted February 4, 2018 40 minutes ago, NeXuS™ said: You have to modify the alpha of it (tocolor(r, g, b, alpha)), depending on the distance, which you can get using getDistanceBetweenPoints3D. ---example¿? function jobL() for k, v in ipairs(getElementsByType("marker")) do local info = getElementData(v, "infojob") if info then local x, y, z = getElementPosition(localPlayer) local mx, my, mz = getElementPosition(v) local a, b = 50, 30 local cx, cy, cz = getCameraMatrix() if getDistanceBetweenPoints3D(x, y, z, mx, my, mz + 0.5) < 65 and isLineOfSightClear(cx, cy, cz, mx, my, mz + 0.5, true, true, false) then local sx, sy = getScreenFromWorldPosition(mx, my, mz + 0.5) if sx and sy then sx, sy = sx - a, sy - b dxDrawText(info, (sx - 30)-1, sy-1, sx-1, sy-1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy-1, sx+1, sy-1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, (sx - 30)-1, sy+1, sx-1, sy+1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, (sx - 30)+1, sy+1, sx+1, sy+1, tocolor(r, g, b, alpha), 0.6, "bankgothic") dxDrawText(info, sx - 30, sy, sx, sy, tocolor(243, 0, 0, alpha), 0.6, "bankgothic") end end end end end addEventHandler("onClientRender", root, jobL) ?? look broth Link to comment
NeXuS™ Posted February 4, 2018 Share Posted February 4, 2018 No, not like that. I'm not going to write you every single line. This section is for those who want to get better at scripting. I don't feel like you want to because you don't try it at all. 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