@Mr.Loki
How to create 3d image with get screen from world position, but with the same image size, even if i am away from that position.
100 dist from image = size=200
I want to do it so:
200 dist from image = The same sizes of image as on 100 dist
Image is always as big as i want even if i am much distance from that position
How to do???
My code, Here the picture increases with respect to distance, and I want to do as I described above.
local element = createVehicle(411, 0, 0, 0)
addEventHandler("onClientRender", root, function()
local playerPosition = {getElementPosition(localPlayer)}
local elementPosition = {getElementPosition(element)}
local distance = math.floor(getDistanceBetweenPoints3D(elementPosition[1], elementPosition[2], elementPosition[3], playerPosition[1], playerPosition[2], playerPosition[3]))
local coords = {getScreenFromWorldPosition(elementPosition[1], elementPosition[2], elementPosition[3]+0.3)}
local clear = isLineOfSightClear(elementPosition[1], elementPosition[2], elementPosition[3], playerPosition[1], playerPosition[2], playerPosition[3], false, false, false, false, true, false, false, nil)
if coords[1] and clear then
dxDrawText(distance.."m", coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 2, "default-bold", "center", "center", false, false)
dxDrawImage(coords[1], coords[2], 64, 64, "asd.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
end)
Help, please