local sw,sh = guiGetScreenSize()
myFont = dxCreateFont( "czcionka.ttf", 17 )
addEventHandler("onClientRender", root, function()
local rx,ry,rz = getCameraMatrix()
for i,v in ipairs(getElementsByType("vehicle", root)) do
local opis = getElementData(v, "pojazd_opis")
if opis then
local x,y,z = getElementPosition(v)
local distance = getDistanceBetweenPoints3D(rx,ry,rz,x,y,z)
if distance <= 25 then
local sx,sy = getScreenFromWorldPosition(x,y,z, 200)
if sx and sy then
dxDrawText(opis, sx-(sw/5),sy,sx+(sw/5),sy, tocolor(255, 255, 255, 155), 1.2, "default-small", "center", "center", false, true)
end
end
end
end
end)