iprint | Multi Theft Auto: Wiki Skip to content

iprint

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function intelligently outputs debug messages into the Debug Console. It is similar to outputDebugString, but outputs useful information for any variable type, and does not require use of Lua's tostring. This includes information about element types, and table structures. It is especially useful for quick debug tasks.

Syntax

iprint ( )

Code Examples

server

This example prints some sample debug messages, assuming the server is running a typical freeroam/play environment:

function resourceStartNotify ( resourcename )
-- Example of outputting tables, and elements directly
iprint(getElementsByType("player"))
iprint(getElementsByType("vehicle"))
-- Example of outputting multiple items at once
iprint("this resource:",getThisResource(),"state:",getResourceState(getThisResource()),"resource root:",getResourceRootElement(getThisResource()))
end
addEventHandler( "onResourceStart", getRootElement(), resourceStartNotify )