local my_font = renderCreateFont('PricedownBl-Regular', 14)
local waypoint = renderLoadTextureFromFile('moonloader/resource/images/radar_waypoint.png')
if script_properties then
script_properties('work-in-pause','forced-reloading-only')
end
function main()
while true do wait(0)
local result, Wx, Wy, Wz = getTargetBlipCoordinates()
if result then
local waypoint2DCoords = { convert3DCoordsToScreen(Wx, Wy, Wz) }
local Px, Py, Pz = getCharCoordinates(PLAYER_PED)
local player2DCoords = { convert3DCoordsToScreen(Px, Py, Pz) }
local dist = math.sqrt((Px-Wx)^2+(Py-Wy)^2+(Pz-Wz)^2)
if dist < 3600 then
end
if ({convert3DCoordsToScreenEx(Wx, Wy, Wz)})[4] > 0 then
renderDrawTexture(waypoint, waypoint2DCoords[1], waypoint2DCoords[2], 24, 24, 0, -1)
renderFontDrawText(my_font, string.format("{b4FFFFFF}%.f", dist), waypoint2DCoords[1], waypoint2DCoords[2] + 14)
end
end
end
end