GetColShapeType

From Multi Theft Auto: Wiki
Revision as of 06:47, 1 July 2018 by CrosRoad95 (talk | contribs) (Created page with "{{Server client function}} __NOTOC__ {{New feature/item|3.0156|1.5.5|12251|This function is used to retrieve the type of an colshape.}} ==Syntax== <syntaxhighlight lang="lua...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Syntax

string getColShapeType ( colshape theColShape )  

OOP Syntax Help! I don't understand this!

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


Required Arguments

  • theColshape: The colShape you wish to get the type of.

Returns

Returns a string containing the colshapetype, false if invalid arguments were passed.

Example

Click to collapse [-]
Shared

This example show type of every possible shape type.

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), circle:getShapeType(), circle.shapeType)
iprint("cubboid",getColShapeType(cubboid), cubboid:getShapeType(), cubboid.shapeType)
iprint("sphere",getColShapeType(sphere), sphere:getShapeType(), sphere.shapeType)
iprint("rectangle",getColShapeType(rectangle), rectangle:getShapeType(), rectangle.shapeType)
iprint("polygon",getColShapeType(polygon), polygon:getShapeType(), polygon.shapeType)
iprint("tube",getColShapeType(tube), tube:getShapeType(), tube.shapeType)

See Also