Jump to content

distance around a ped with no marker + 3D


papam77

Recommended Posts

Hello guys,

Is possible to do distance around ped with no marker?

I mean if is player 5m near to ped then he can press X or something to open Ped's menu?

I need it with no marker.

And why is the text floating on my screen randomly when I look to a ped

function md () 
local get3D = getScreenFromWorldPosition ( 2184.70, -3279.12, 1684.65 ) 
  
dxDrawText ( "PED1", get3D,tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) 
end 
addEventHandler ("onClientRender", root, md ) 

Link to comment

getScreenFromWorldPosition returns two values; X and Y coordinate. You're currently only checking for one value. Also, you don't have the proper values set in dxDrawText. It goes like this: dxDrawText(string, float, float, float, float, color...).

In order to do that ped thing, make a bind on X key and whenever they press the key the script will check the distance between the elements with getDistanceBetweenPoints3D.

Link to comment
function md () 
local x3D, y3D = getScreenFromWorldPosition ( 2184.70, -3279.12, 1684.65 ) 
    if x3D and y3D then 
        dxDrawText ( "PED1", x3D, y3D, 500,500,tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) 
    end 
end 
addEventHandler ("onClientRender", root, md ) 

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