DgsSwitchButtonSetState

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

Syntax

bool dgsSwitchButtonSetState( element switchButton, state )

Required Arguments

  • switchButton: Switch you want to set the state.
  • state: the state you want to set ( true or false ).

Returns

Returns true if the state of switch button has been changed successfully, false otherwise.

Example

DGS = exports.dgs
button = DGS:dgsCreateSwitchButton( 0.7, 0.1, 0.2, 0.1, "On", "Off", false, true )
addCommandHandler("switch", function()
    DGS:dgsSwitchButtonSetState(button, true)
end)