inspect
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
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
- string: value
Always returns a string. The contents can change if we update the inspect library, so it is not expected to be consistent across Lua versions.
Code Examples
shared
This 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)See Also
Utility Functions
- addDebugHook
- bitAnd
- bitArShift
- bitExtract
- bitLRotate
- bitLShift
- bitNot
- bitOr
- bitReplace
- bitRRotate
- bitRShift
- bitTest
- bitXor
- createTrayNotification
- debugSleep
- decodeString
- deref
- downloadFile
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getKeyboardLayout
- getLocalization
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getProcessMemoryStats
- getRealTime
- getServerIp
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTimer
- isTimerPaused
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- ref
- removeDebugHook
- resetTimer
- setClipboard
- setDevelopmentMode
- setFPSLimit
- setTimer
- setTimerPaused
- setTransferBoxVisible
- setWindowFlashing
- sha256
- showCol
- showSound
- split
- teaDecode
- teaEncode
- tocolor
- toJSON
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub