IsMainMenuActive: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Client function}} This function returns whether the user is in the mainmenu or not. ==Syntax== <syntaxhighlight lang="lua"> bool isMainMenuActive () </syntaxhighlight> ===Returns=== Returns ''true'...)
 
m (OOP Syntax fix)
 
(5 intermediate revisions by 4 users not shown)
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool isMainMenuActive ()
bool isMainMenuActive ()
</syntaxhighlight>  
</syntaxhighlight>
{{OOP||[[GUI widgets|GuiElement]].isMainMenuActive|mainMenuActive|}}


===Returns===
===Returns===
Line 12: Line 13:


==Example==  
==Example==  
This example does...
This example check if the player is afk.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function isLocalPlayerActive ()
blabhalbalhb --abababa
  if isMainMenuActive() then
--This line does this...
      setElementData(getLocalPlayer(),"status","afk")
mooo
  else
      setElementData(getLocalPlayer(),"status","playing")
  end
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
[[Category:Needs Example]]
{{GUI_events}}

Latest revision as of 16:25, 14 May 2021

This function returns whether the user is in the mainmenu or not.

Syntax

bool isMainMenuActive ()

OOP Syntax Help! I don't understand this!

Method: GuiElement.isMainMenuActive(...)
Variable: .mainMenuActive


Returns

Returns true if the mainmenu is visible, false if not.

Example

This example check if the player is afk.

function isLocalPlayerActive ()
   if isMainMenuActive() then
      setElementData(getLocalPlayer(),"status","afk")
   else
      setElementData(getLocalPlayer(),"status","playing")
   end
end

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