Difference between revisions of "OnDgsCheckBoxChange"

From Multi Theft Auto: Wiki
(Created page with "{{Client event}} __NOTOC__ This event is triggered each time the dgs check box state has changed. ==Parameters== <syntaxhighlight lang="lua"> bool state </syntaxhighlight>...")
 
m (Fixed not calling exported function.)
 
Line 15: Line 15:
 
DGS = exports.dgs
 
DGS = exports.dgs
  
local cb1 = dgsCreateCheckBox(300,300,200,30,"CheckBox Test 1",false)
+
local cb1 = DGS:dgsCreateCheckBox(300,300,200,30, "CheckBox Test 1", false)
local cb2 = dgsCreateCheckBox(300,320,200,30,"CheckBox Test 2",false)
+
local cb2 = DGS:dgsCreateCheckBox(300,320,200,30, "CheckBox Test 2", false)
  
 
function onStateChanged(state)
 
function onStateChanged(state)

Latest revision as of 22:21, 2 June 2018

This event is triggered each time the dgs check box state has changed.

Parameters

bool state

Source

The source of this event is the dgs check box.

Example

DGS = exports.dgs

local cb1 = DGS:dgsCreateCheckBox(300,300,200,30, "CheckBox Test 1", false)
local cb2 = DGS:dgsCreateCheckBox(300,320,200,30, "CheckBox Test 2", false)

function onStateChanged(state)
	if source == cb1 and state == true then
		outputChatBox("Selected CheckBox 1")
	end
end
addEventHandler("onDgsCheckBoxChange", root, onStateChanged)

See Also

DGS events

Plugin

Media

Color Picker

Client event functions