ShowCol: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
{{New feature/item|3.0160|1.5.8|20840|Shows collision previews for developers.}}
{{Added feature/item|1.5.9|1.5.8|20844|Shows collision previews for developers ([[colshape]]s in wireframe, useful when writing scripts).}}
{{Note|This function only works in development mode.}}


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">bool showCol ( bool state )</syntaxhighlight>
<syntaxhighlight lang="lua">bool showCol ( bool state )</syntaxhighlight>
===Required Arguments===  
===Required Arguments===  
*'''state:''' true/false
*'''state:''' A [[boolean]] indicating if the collision previews should be enabled or disabled.
===Returns===
===Returns===
* If the operation is executed, it returns 'true', otherwise it returns 'false'.
* Returns ''true'' if the function is successful, ''false'' otherwise.


==Example==
==Example==
You can refer to the example below.
You can refer to the example below:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
setDevelopmentMode(true)
setDevelopmentMode (true)


addCommandHandler("devdebug",
addCommandHandler ("devdebug",
     function()
     function ()
         showCol(not isShowCollisionsEnabled())
         showCol (not isShowCollisionsEnabled())
     end
     end
)
)
Line 23: Line 24:


==Requirements==
==Requirements==
{{Requirements|n/a|1.5.8-9.20840|}}
{{Requirements|n/a|1.5.8-9.20844|}}


==See Also==
==See Also==
{{Client_utility_functions}}
{{Client_utility_functions}}

Latest revision as of 17:29, 28 September 2021

Shows collision previews for developers (colshapes in wireframe, useful when writing scripts).

[[{{{image}}}|link=|]] Note: This function only works in development mode.

Syntax

bool showCol ( bool state )

Required Arguments

  • state: A boolean indicating if the collision previews should be enabled or disabled.

Returns

  • Returns true if the function is successful, false otherwise.

Example

You can refer to the example below:

setDevelopmentMode (true)

addCommandHandler ("devdebug",
    function ()
        showCol (not isShowCollisionsEnabled())
    end
)

Requirements

Minimum server version n/a
Minimum client version 1.5.8-9.20844

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20844" />

See Also