local MAX_DISTANCE = 25 addEventHandler("onClientRender", root, function() local px, py, pz = getElementPosition(localPlayer) for _, veh in ipairs(getElementsByType("vehicle", root, true)) do if isElementOnScreen(veh) then local distance = getDistanceBetweenPoints3D(px, py, pz, getElementPosition(veh)) if distance <= MAX_DISTANCE then local components = getVehicleComponents(veh) local scale = math.min(5 / distance, 1) for componentName in pairs(components) do local x, y, z = getVehicleComponentPosition(veh, componentName, "world") if x and isLineOfSightClear(px, py, pz, x, y, z, true, false, false, true, false, false, false) then dxDraw3DText(componentName, x, y, z + 0.1, tocolor(255, 200, 0, 255), scale, "default-bold") end end end end end end) -- Função auxiliar para desenhar texto 3D na tela function dxDraw3DText(text, x, y, z, color, scale, font, ...) local sx, sy = getScreenFromWorldPosition(x, y, z) if sx and sy then dxDrawText(text, sx + 1, sy + 1, sx + 1, sy + 1, tocolor(0, 0, 0, 200), scale, font, "center", "center", ...) dxDrawText(text, sx, sy, sx, sy, color, scale, font, "center", "center", ...) end end exports['vAttach']:attach(createObject(1337, 0, 0, 0, 0, 0, 0, false), getPedOccupiedVehicle(localPlayer), "Giroflex", 0, 0, 0, 0, 0, 0);