Jump to content

[Help]How to Get Nearest Point ?


3B00DG4MER

Recommended Posts

getDistanceBeetwenPoints3D

Can you fix that ?!

addEventHandler ( "onPlayerWasted", root, 
function () 
local x,y,z = getElementPosition( source ) 
h1 = getDistanceBetweenPoints3D ( x, y, z, 1177.60034117969, -1325.5480957031, 15.078706741333 ) 
h2 = getDistanceBetweenPoints3D ( x, y, z, 2026.0512695313, -1407.1281738281, 17.190994262609 ) 
if h1 > h2 then 
setElementPosition ( source, 1177.60034117969, -1325.5480957031, 15.078706741333 ) 
else 
setElementPosition ( source, 2026.0512695313, -1407.1281738281, 17.190994262609 ) 
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...