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

Function

guiCreateGridList

Creates a list with columns (a table). Add columns with guiGridListAddColumn and rows with guiGridListAddRow.

Syntax

gui-gridlist guiCreateGridList(float x, float y, float width, float height, bool relative [, element parent = nil])

Arguments

xfloat
X position.
yfloat
Y position.
widthfloat
Width.
heightfloat
Height.
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

guiCreateGridList(float x, float y, float width, float height, bool relative = false, gui-element parent = nil)

Returns

The list.

Example

A player list with health.

local win = guiCreateWindow(100, 100, 360, 400, "Gracze", false)
local list = guiCreateGridList(10, 35, 340, 355, false, win)
guiGridListAddColumn(list, "Nick", 0.7)
guiGridListAddColumn(list, "Zdrowie", 0.2)
for _, p in ipairs(getElementsByType("player")) do
    local row = guiGridListAddRow(list, getPlayerName(p), math.floor(getElementHealth(p)))
    guiGridListSetItemData(list, row, 1, p)
end

See also