Difference between revisions of "SetPlayerScriptDebugLevel"

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
 
Line 33: Line 33:
  
 
==Requirements==
 
==Requirements==
{{Requirements|1.5.7-9.19626||}}
+
{{Requirements|1.5.7-9.19626|n/a|}}
  
 
==See Also==
 
==See Also==
 
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
 
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
 
{{Player_functions}}
 
{{Player_functions}}

Latest revision as of 14:15, 25 October 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
Counterpart: getPlayerScriptDebugLevel

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

function setPlayerDebug (player)
    setPlayerScriptDebugLevel(player, 3)
    outputChatBox("You set debug script level to 3", player)
end 
addCommandHandler("setdebug", setPlayerDebug) 

Requirements

Minimum supported server 1.5.7-9.19626
Minimum supported client n/a

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.7-9.19626" />

See Also