IsMTAWindowActive

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.


[[{{{image}}}|link=|]] Note: You cannot rely on this function to get the focus state of the MTA window - use isMTAWindowFocused instead

Syntax

bool isMTAWindowActive ()

OOP Syntax Help! I don't understand this!

Method: GuiElement.isMTAWindowActive(...)


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

Input

GUI