isMTAWindowActive | Multi Theft Auto: Wiki Skip to content

isMTAWindowActive

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

Note

You cannot rely on this function to get the focus state of the MTA window - use isMTAWindowFocused instead

OOP Syntax Help! I don't understand this!

Syntax

bool isMTAWindowActive ( )

Returns

  • bool: value

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

Code Examples

shared

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

GUI Functions