getColShapeType | Multi Theft Auto: Wiki Skip to content

getColShapeType

Client-side
Server-side
Shared

This function is used to retrieve the type of an colshape.

OOP Syntax Help! I don't understand this!

  • Method:colshape:getShapeType(...)
  • Variable: .shapeType

Syntax

int|false getColShapeType ( ​colshape shape )
Required arguments
  • shape: The colshape you wish to get the type of.

Returns

Returns false if invalid arguments were passed, or an integer of the type of the colshape (see above).

  • int|false: colshape-type
    • 0: circle
    • 1: cuboid
    • 2: sphere
    • 3: rectangle
    • 4: polygon
    • 5: tube

Code Examples

shared

This example outputs the type of all colshapes.

local circle = createColCircle(0, 0, 1)
local cubboid = createColCuboid(0, 0, 0, 0, 0, 0)
local sphere = createColSphere(0, 0, 0, 0)
local rectangle = createColRectangle(0, 0, 0, 0)
local polygon = createColPolygon(0, 0, 0, 0, 0, 0, 0, 0)
local tube = createColTube(0, 0, 0, 0, 0)
iprint("circle", getColShapeType(circle))
iprint("cubboid", getColShapeType(cubboid))
iprint("sphere", getColShapeType(sphere))
iprint("rectangle", getColShapeType(rectangle))
iprint("polygon", getColShapeType(polygon))
iprint("tube", getColShapeType(tube))