debugSleep | Multi Theft Auto: Wiki Skip to content

debugSleep

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.


debugSleep freezes the client/server for the specified time. This means that all synchronization, rendering and script execution will stop except HTTP processing invoked by fetchRemote. This function only works, if development mode is enabled by setDevelopmentMode and can be utilised to build a debugger that communicates via HTTP requests with the editor/IDE.

Caution

Only use this function if you know what you are doing!

Syntax

bool debugSleep ( int sleep )
Required Arguments
  • sleep: An integer value in milliseconds.

Returns

  • bool: value

Returns true if the development mode is enabled and arguments are correct, false otherwise.

Code Examples

shared
addCommandHandler ( "zzz",
function ( command, sleep )
if ( sleep ) then
local ms = tonumber ( sleep )
if ( ms ) then
debugSleep ( ms )
end
end
end
)