SetPlayerScriptDebugLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Set function server side since the function doesnt exists on client)
m (fix typo)
Line 9: Line 9:
bool setPlayerScriptDebugLevel ( player thePlayer, int level )
bool setPlayerScriptDebugLevel ( player thePlayer, int level )
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[player]]:setScriptDebugLevel|getScriptDebugLevel}}
{{OOP||[[player]]:setScriptDebugLevel|scriptDebugLevel}}
===Required Arguments===  
===Required Arguments===  
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->

Revision as of 01:44, 29 March 2020

This will set player's debug level, equivalent to debugscript <level>.

Syntax

bool setPlayerScriptDebugLevel ( player thePlayer, int level )

OOP Syntax Help! I don't understand this!

Method: player:setScriptDebugLevel(...)
Variable: .scriptDebugLevel


Required Arguments

  • thePlayer: The player whose debug level you wish to change
  • level: 0: close debug console, 1: only errors, 2: errors and warnings, 3: errors, warnings and info messages

Returns

Returns true if successful, false otherwise.

Example

Click to collapse [-]
Server

This code will set joining players debug level to (3), (It is no recommended to use it in production, specially if you have sensitive data in your logs).

addEventHandler('onPlayerJoin', root, function()
    setPlayerScriptDebugLevel(source, 3)
end)

See Also