DgsSwitchButtonGetState

From Multi Theft Auto: Wiki
Revision as of 08:34, 22 April 2020 by Temois (talk | contribs) (Created page with "==Syntax== <syntaxhighlight lang="lua"> bool dgsSwitchButtonGetState( element switchButton ) </syntaxhighlight> ===Required Arguments=== *'''switchButton:''' Switch you wa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax

bool dgsSwitchButtonGetState( element switchButton )

Required Arguments

  • switchButton: Switch you want to get the state from.

Returns

Returns a bool of the Switch Button.

Example

DGS = exports.dgs
button = DGS:dgsCreateSwitchButton( 0.7, 0.1, 0.2, 0.1, "On", "Off", true, true )
addEventHandler ( "onDgsMouseClickDown", button, function()
        outputChatBox ( "The switch turns "..(DGS:dgsSwitchButtonGetState(source) and "on" or "off"))
end)