IsDebugViewActive: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client function}} This function returns whether the ingame debug window is visible or not. This is the debugwindow visible using the "debugscript <level>" command. ==Syntax==...)
 
 
(3 intermediate revisions by 3 users not shown)
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool isDebugViewActive ()
bool isDebugViewActive ()
</syntaxhighlight>  
</syntaxhighlight>
{{OOP||[[GUI widgets|GuiElement]].isDebugViewActive|debugViewActive|setDebugViewActive}}


===Returns===
===Returns===
Line 12: Line 13:


==Example==  
==Example==  
This example does...
This example makes a /debug command to check if the client's debugscript is on or off.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function checkDebug () -- The function header
blabhalbalhb --abababa
if ( isDebugViewActive() ) then -- Check if debugscript is active...
--This line does this...
outputChatBox ( "You currently have debugscript on." ) -- If it is, output that it is
mooo
else -- If it returns anything else (that it's not active)...
outputChatBox ( "You currently have debugscript off." ) -- Output that they haven't got it on.
end
end
addCommandHandler ( "debug", checkDebug ) -- Execute the script when the client types "/debug"
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
[[Category:Needs Example]]
{{GUI_events}}

Latest revision as of 17:21, 21 November 2018

This function returns whether the ingame debug window is visible or not. This is the debugwindow visible using the "debugscript <level>" command.

Syntax

bool isDebugViewActive ()

OOP Syntax Help! I don't understand this!

Method: GuiElement.isDebugViewActive(...)
Variable: .debugViewActive
Counterpart: setDebugViewActive


Returns

Returns true if the debug view is visible, false if not.

Example

This example makes a /debug command to check if the client's debugscript is on or off.

function checkDebug () -- The function header
	if ( isDebugViewActive() ) then -- Check if debugscript is active...
		outputChatBox ( "You currently have debugscript on." ) -- If it is, output that it is
	else -- If it returns anything else (that it's not active)...
		outputChatBox ( "You currently have debugscript off." ) -- Output that they haven't got it on.
	end
end
addCommandHandler ( "debug", checkDebug ) -- Execute the script when the client types "/debug"

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI