GetDistance3D
From Onset Developer Wiki
Description
Gets the distance in centimeters between 3 dimensional points.
Syntax
GetDistance3D(x, y, z, x2, y2, z2)
Parameters
- x
x of the first point. - y
y of the first point. - z
z of the first point. - x2
x of the second point. - y2
y of the second point. - z2
z of the second point.
Return Value
- The distance between the 2 points in centimeters.
Example
local x, y, z = GetPlayerLocation()
local distance = GetDistance3D(x, y, z, 2000, 13245, 1000)
AddPlayerChat("You're " .. (tonumber(distance) / 100) .. " meters from the position.")