Jump to content

help text


franku

Recommended Posts

try this

   local maxDistance = 12 -- the distance showing 3dtext 
   local ped = createPed (ID,x,y,z) 
      
    addEventHandler ( "onClientRender", root, 
        function ( ) 
     local pX, pY, pZ = getElementPosition ( localPlayer ) 
            local pedX, pedY, pedZ = getElementPosition ( ped ) 
            local distance = getDistanceBetweenPoints3D ( pX, pY, pZ, pedX, pedY, pedZ ) 
            
            if ( distance <= 12 ) then 
                local x, y = getScreenFromWorldPosition ( pedX, pedY, pedZ ) 
                if ( x and y ) then 
                dxDrawText( "Text here", x, y+1.5, _, _, tocolor( 255, 0, 0, 255 ), 1, myFont, "center", "center" ) 
                end 
            end 
        end 
    ) 

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...