DebugSleep: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function is used to set the freeze time for the client/server. This means that all synchronization, frame updating and script's execu...")
 
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
This function is used to set the freeze time for the client/server. This means that all synchronization, frame updating and script's execution will stop.
_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.
 
{{Warning|Only use this function if you know what you are doing!|true}}


==Syntax==
==Syntax==

Revision as of 11:48, 21 September 2017

_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.

Dialog-warning.png Warning: 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

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

Requirements

This template will be deleted.

Example

Example 1: This example would add the command to set the client's freeze time.

Click to collapse [-]
Client
addCommandHandler ( "zzz",
    function ( command, sleep )
        debugSleep ( sleep )
    end
)

See Also