isMTAWindowActive | Multi Theft Auto: Wiki Skip to content

isMTAWindowActive

Client-side
Server-side
Shared

This function returns whether any system windows that take focus are active. This includes chatbox input, console window, main menu and transfer box.

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!

  • Method:GuiElement.isMTAWindowActive(...)
  • Variable: .mtaWindowActive

Syntax

bool isMTAWindowActive ( )

Returns

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

  • bool: result

Code Examples

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(localPlayer, 0.0)
end
end
setTimer(dontAllowAnyOpenWindow, 50, 0)

See Also

GUI Functions