- Documentation
- Shared functions
- getDistanceBetweenPoints2D
Function
getDistanceBetweenPoints2D
Computes the distance between two points on a plane (without height).
Syntax
float getDistanceBetweenPoints2D(float x1, float y1, float x2, float y2)Arguments
x1float- X of the first point.
y1float- Y of the first point.
x2float- X of the second point.
y2float- Y of the second point.
Returns
Distance in metres.
Example
local x, y = getElementPosition(player)
if getDistanceBetweenPoints2D(x, y, 2495, -1687) < 50 then
outputChatBox("Jesteś na Grove Street.", player)
end