GetNearestGate
The gate nearest a point, within a radius.
A gate is a big thing: the radius is tens of metres, not the couple a door needs (60 by default, the same as /gate).
Syntax
Section titled “Syntax”GetNearestGate(x, y, z [, radius])| Parameter | Type | |
|---|---|---|
x |
number | metres |
y |
number | metres |
z |
number | metres |
radius |
number | metres (default 60) (optional) |
Returns
Section titled “Returns”string - the gate’s key, or nil when none lies within the radius
Example
Section titled “Example”local key = GetNearestGate(GetPlayerPos(pid))if key then ToggleGate(key) endSee also
Section titled “See also”GetGates · ToggleGate · the Gates group of the index
