- Documentation
- Shared functions
- isElementNear
Function
isElementNear
Checks whether an element is within a radius of another element or of a point. For a target element it also checks the dimension and interior.
Syntax
bool isElementNear(element element, mixed ...)Arguments
elementelement- The element to check.
...mixedtarget, radiusorx, y, z, radius[, dimension, interior].
Returns
true if the element is in range; also false for an invalid element.
Example
addCommandHandler("napraw", function(player)
if not isElementNear(player, 1024, -1024, 32, 5) then
outputChatBox("Podejdź do warsztatu.", player)
return
end
local veh = getPedOccupiedVehicle(player)
if veh then fixVehicle(veh) end
end)