M MY Multiplayer: Wiki
Side
Kind

isElementWithinColShape

Shared

Tells whether an element is inside a collision shape.

bool isElementWithinColShape(element element, element shape)

Parameters

NameTypeDescription
elementelementThe element.
shapeelementThe 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

See also