for _, v in pairs(getAllObjects()) do
local asd
if sampGetObjectSampIdByHandle(v) ~= -1 then
asd = sampGetObjectSampIdByHandle(v)
end
if isObjectOnScreen(v) then
local result, oX, oY, oZ = getObjectCoordinates(v)
local x1, y1 = convert3DCoordsToScreen(oX,oY,oZ)
local objmodel = getObjectModel(v)
local x2,y2,z2 = getCharCoordinates(PLAYER_PED)
local x10, y10 = convert3DCoordsToScreen(x2,y2,z2)
distance = string.format("%.0f", getDistanceBetweenCoords3d(oX,oY,oZ, x2, y2, z2))
if objmodel == id then renderFontDrawText(font, "Объект \n{ff0000}Дистанция: "..distance, x1, y1, -1) renderDrawLine(x10, y10, x1, y1, mainIni.config.tol*0.5, 0xFFD00000) end
end
end