isElementWithinColShape
Shared
Tells whether an element is inside a collision shape.
bool isElementWithinColShape(element element, element shape)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The element. |
| shape | element | The collision shape. |
Returns
true if the element is inside.
Only players, peds, vehicles and objects enter a shape. The answer comes from the last check, the same one that fires onColShapeHit, so an element just moved counts only after it.
Example
if isElementWithinColShape(player, safeZone) then
return
end