Jump to content

dxdraw


joedajoester

Recommended Posts

local distance = 70 
local screenSizeX, screenSizeY = guiGetScreenSize() 
local scale = 7 
local myImage = "mtalogo.png" 
local x, y, z = 0, 0, 5 
  
function renderImage() 
    local px, py, pz = getElementPosition ( localPlayer ) 
    local dist = getDistanceBetweenPoints3D ( px, py, pz, x, y, z ) 
    if (dist < distance and isLineOfSightClear( px, py, pz, x, y, z, true, false, false, false )) then 
        local screenX, screenY = getScreenFromWorldPosition ( x, y, z+0.5 ) 
        local scaled = screenSizeX * (1/(2*(dist+5))) *.85 
        local relX, relY = scaled * scale, scaled * scale 
        if ( screenX and screenY ) then 
            dxDrawImage( screenX, screenY, relX, relY, tostring(myImage) ) 
        end 
    end 
end 
addEventHandler( "onClientRender", root, renderImage ) 

Change: x, y, z to your 3D world coordinates.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...