Inspect

From Multi Theft Auto: Wiki
Revision as of 19:52, 17 December 2016 by Loki (talk | contribs) (added image to example)
Jump to navigation Jump to search

This function returns human-readable representations of tables and MTA datatypes as a string.

Syntax

string inspect ( mixed var )             

Required Arguments

  • var: A variable of any datatype.

Returns

Always returns a string.

Example

Click to collapse [-]
Client

This example draws the contents of a table and its data type:

local Table = {    
    ["matrix"] = {position = {getElementPosition(localPlayer)},rotation = {getElementRotation( localPlayer )}},
    ["localplayer"] = getPlayerName(localPlayer),
}

addEventHandler("onClientRender",root,
    function( )
        dxDrawText(inspect(Table),10,250)
    end
)

This is an example of what it should look like:

InspectReturn.png

See Also