local maxVisibleUnit = 50
addEventHandler(\"onClientResourceStart\", resourceRoot, function()
testMarker = createMarker(-2498.2028808594, -602.4130859375, 131.22196960449, \"cylinder\", 3, 117, 16, 16, 100)
end)
addEventHandler(\"onClientRender\", root, function()
local cameraX, cameraY, cameraZ = getCameraMatrix()
if getElementDimension(testMarker) == getElementDimension(localPlayer) then
local markerX, markerY, markerZ = getElementPosition(testMarker)
local markerDistance = getDistanceBetweenPoints3D(cameraX, cameraY, cameraZ, markerX, markerY, markerZ)
if markerDistance <= maxVisibleUnit then
local screenX, screenY = getScreenFromWorldPosition(markerX, markerY, markerZ + 2, 1)
if screenX and screenY then
local imageS = 1 - markerDistance / maxVisibleUnit / 2
local imageW, imageH = 256 * imageS, 128 * imageS
local imageX, imageY = screenX - imageW / 2, screenY - imageH / 2
dxDrawImage(imageX, imageY, imageW, imageH, \"test.png\", 0, 0, 0, tocolor(255, 255, 255, 150))
end
end
end
end)