ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. guiCreateCheckBox

Function

guiCreateCheckBox

Creates a check box (yes/no).

Syntax

gui-checkbox guiCreateCheckBox(float x, float y, float width, float height, string text, bool selected, bool relative [, element parent = nil])

Arguments

xfloat
X position.
yfloat
Y position.
widthfloat
Width.
heightfloat
Height.
textstring
Text.
selectedbool
Whether checked at start.
relativebool
Relative values.Optional in MTA:SA: bool relative = false
parentelement, optional = nil
Parent.

Differences from MTA:SA

  • Arguments in a different colour differ from MTA:SA.

In MTA:SA

guiCreateCheckBox(float x, float y, float width, float height, string text, bool selected, bool relative = false, gui-element parent = nil)

Returns

The check box.

Example

local hud = guiCreateCheckBox(20, 20, 200, 24, "Pokaż licznik", true, false)
addEventHandler("onClientGUIClick", hud, function()
    showSpeedo = guiCheckBoxGetSelected(hud)
end, false)

See also