From Multi Theft Auto: Wiki
Jump to navigation Jump to search

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!


bool debugSleep ( int sleep )

Required Arguments

  • sleep : An integer value in milliseconds.


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


Minimum supported server version 1.5.4-9.11306
Minimum supported client version 1.5.4-9.11306

Note: Using this function/event requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.5.4-9.11306" client="1.5.4-9.11306" />


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

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

See Also

* FEATURE ADDED IN 1.5.9 (BETA: 1.5.8 r20840):
* FEATURE ADDED IN 1.5.9 (BETA: 1.5.8 r20788):
* FEATURE ADDED IN 1.5.9 (BETA: 1.5.8 r20788):
* FEATURE ADDED IN 1.5.9 (BETA: 1.5.8 r20840):