createColCircle
Shared
Creates a circular collision shape with no height limit.
element|false createColCircle(float x, y, float radius)
Parameters
| Name | Type | Description |
|---|---|---|
| x, y | float | The circle's centre. A vec2 also works. |
| radius | float | The radius in metres. |
Returns
The created colshape element, or false if it could not be created.
A collision shape detects players, peds, vehicles and objects by their position and fires onColShapeHit and onColShapeLeave (onClientColShapeHit and onClientColShapeLeave on a client). It goes away when the resource that created it stops.
Example
local zone = createColCircle(1480.0, -1740.0, 25)
addEventHandler("onColShapeHit", zone, function(hitElement)
if getElementType(hitElement) == "player" then
outputDebugString(getPlayerName(hitElement) .. " entered the plaza")
end
end)