Inspect
From Multi Theft Auto: Wiki
This function returns human-readable representations of tables and MTA datatypes as a string.
Syntax
string inspect ( mixed var [, table options] )
Required Arguments
- var: A variable of any datatype.
- options: A table of options. It is not mandatory, but when it is provided, it must be a table. For a list of options, see the Inspect's GitHub page.
Returns
Always returns a string.
Example
Click to collapse [-]
ClientThis example draws the contents of a table and its data type:
local Table = { ["matrix"] = {position = {getElementPosition(localPlayer)},rotation = {getElementRotation( localPlayer )}}, ["localplayer"] = getPlayerName(localPlayer), } local inspectedTblStr = inspect(Table) addEventHandler("onClientRender",root, function( ) --> then draw the created string. --> Try to NOT use such functions under onClientRender, since it works with loops, and if we want to print a bigger table, it will drop some frames. dxDrawText(inspectedTblStr,10,250) end )
This is an example of what it should look like:
See Also
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace
- debugSleep
- decodeString
- encodeString
- fromJSON
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getServerConfigSetting
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setServerConfigSetting
- setTimer
- sha256
- split
- teaDecode
- teaEncode