- Documentation
- Server functions
- getColPolygonPoints
Function
getColPolygonPoints
Returns all vertices of a polygon zone as a table of {x, y} pairs.
Syntax
table getColPolygonPoints(colshape shape)Arguments
shapecolshape- A polygon zone.
Returns
A table { {x, y}, ... }, or false for another zone.
Example
local zone = createColPolygon(0, 0, -5, -5, 5, -5, 5, 5)
for i, p in ipairs(getColPolygonPoints(zone)) do outputDebugString(i .. ": " .. p[1] .. ", " .. p[2]) end
See also
getColPolygonPointPositionReturns the position of one vertex of a polygon zone (numbered from 1).createColPolygonCreates a collision zone shaped as any polygon on the map (e.g. a gang territory outline). The first two numbers are the centre point (element position), then x, y pairs of vertices - at least three. No height limit by default;setColPolygonHeightsets a range.