IsMTAWindowActive: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 17: Line 17:
Returns ''true'' if the focus is on the MTA window, ''false'' if it isn't.
Returns ''true'' if the focus is on the MTA window, ''false'' if it isn't.


==Example==  
==Example==
<section name="Client" class="client" show="true">
This piece of script will kill a player if he has any of the above system windows open
This piece of script will kill a player if he has any of the above system windows open
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 28: Line 27:
setTimer ( dontAllowAnyOpenWindow, 50, 0 )
setTimer ( dontAllowAnyOpenWindow, 50, 0 )
</syntaxhighlight>
</syntaxhighlight>
</section>
==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
[[ru:isMTAWindowActive]]
[[ru:isMTAWindowActive]]

Revision as of 18:05, 11 February 2015

This function returns whether any system windows that take focus are active. This includes:

  • Chatbox input
  • Console window
  • Main menu
  • Transferbox

To get the status of the debug view, see isDebugViewActive.

Syntax

bool isMTAWindowActive ()

OOP Syntax Help! I don't understand this!

Note: GuiElement.isMTAWindowActive
Method: mtaWindowsActive(...)


Returns

Returns true if the focus is on the MTA window, false if it isn't.

Example

This piece of script will kill a player if he has any of the above system windows open

function dontAllowAnyOpenWindow ()
	if isMTAWindowActive ()	then
		 setElementHealth ( getLocalPlayer(), 0.0 )
	end	 
end
setTimer ( dontAllowAnyOpenWindow, 50, 0 )

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