function onStart()
local x,y,z = getElementPosition(localPlayer)
vehicle = createVehicle(411, x+2,y+2,z+2)
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()),onStart)
function attachText()
local x,y,z = getElementPosition(vehicle)
local px,py,pz = getElementPosition(getLocalPlayer())
local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )
if distance <= 10 then
local sx,sy = getScreenFromWorldPosition ( x, y, z+0.95, 0.06 )
local scale = 1/(0.3 * (distance / 150))
dxDrawText( \"szöveg\", sx, sy - 30, 50, 50, tocolor(255,255,255,255),1,\"clear\",\"left\",\"top\",true,true,true,true )
end
end
addEventHandler(\"onClientRender\",getRootElement(), attachText)