GetColShapeType: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(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...")
 
(typo)
Line 10: Line 10:


===Required Arguments===  
===Required Arguments===  
*'''theColshape:''' The [[colShape]] you wish to get the type of.
*'''theColshape:''' The [[colshape]] you wish to get the type of.


===Returns===
===Returns===

Revision as of 06:48, 1 July 2018

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