GetPlayerScriptDebugLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Add client-sided variant of this function)
(Remove obsolete Requirements section)
 
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:
{{New feature/item|3.0158|1.5.7|19626|
{{New feature/item|3.0158|1.5.7|19626|
This will allow you to retrieve the player current debug script level.
This will allow you to retrieve the player current debug script level.
}}
{{New feature/item|3.0161|1.6.0|22592|
This function has a client-sided variant, which can only retrieve the local player's script debug level.
}}
}}
==Syntax==  
==Syntax==  
Line 25: Line 28:
int getPlayerScriptDebugLevel()
int getPlayerScriptDebugLevel()
</syntaxhighlight>  
</syntaxhighlight>  
{{OOP||[[player]]:getScriptDebugLevel|debugLevel}}
{{OOP||[[player]]:getScriptDebugLevel|scriptDebugLevel}}


===Returns===
===Returns===
Line 42: Line 45:
addCommandHandler ( "showdebug", showdebug )
addCommandHandler ( "showdebug", showdebug )
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|1.5.7-9.19626|1.6.0-9.22592|}}


==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}}
{{Shared_player_functions}}

Latest revision as of 17:18, 7 November 2024

This will allow you to retrieve the player current debug script level.

ADDED/UPDATED IN VERSION 1.6.0 r22592:

This function has a client-sided variant, which can only retrieve the local player's script debug level.

Syntax

Click to collapse [-]
Server
int getPlayerScriptDebugLevel( player thePlayer )

OOP Syntax Help! I don't understand this!

Method: player:getScriptDebugLevel(...)
Variable: .scriptDebugLevel
Counterpart: setPlayerScriptDebugLevel


Required Arguments

  • thePlayer: The person whose debug script level you want

Returns

Returns an int with the player debug script level, false if the player is invalid.

Click to collapse [-]
Client
int getPlayerScriptDebugLevel()

OOP Syntax Help! I don't understand this!

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


Returns

Returns an int with the local player's debug script level.

Example

Displays a message in the chat what is the player's debug level.

function showdebug (player)
    local level = getPlayerScriptDebugLevel( player )
    outputChatBox( "Your Script Debug Level: " .. level )
end
addCommandHandler ( "showdebug", showdebug )

See Also