IsMTAWindowActive: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (typo)
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
This function returns whether any system windows that take focus are active. This includes the chatbox input, console window, main menu and transferbox.
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]].
To get the status of the debug view, see [[isDebugViewActive]].


Line 14: Line 18:
==Example==  
==Example==  
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
This function kill a player if it comes out in the standard menu MTA
This piece of script will kill a player if he has any of the above system windows open
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function dontAllowAnyOpenWindow ()
function dontAllowAnyOpenWindow ()
if isMTAWindowActive () then
if isMTAWindowActive () then
setElementHealth ( thePlayer, 0.0 )
setElementHealth ( getLocalPlayer(), 0.0 )
end  
end  
end
end

Revision as of 10:20, 31 January 2011

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

Returns

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

Example

Click to collapse [-]
Client

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