guiGridListAddColumn | Multi Theft Auto: Wiki Skip to content

guiGridListAddColumn

Client-side
Server-side
Shared

Pair: guiGridListRemoveColumn

This function is used to create columns in grid lists.

Note

If the width of all columns exceeds 0.95 horizontal scrollbar will appear.

OOP Syntax Help! I don't understand this!

Syntax

int|false guiGridListAddColumn ( ​gui-gridlist gridList, ​string title, ​float width )
Required arguments
  • gridList: The grid list you want to add a column to.
  • title: Title of the column.
  • width: Column width, relative to the grid list width.

Returns

Returns the column id if it was created, false otherwise.

  • int|false: column id

Code Examples

client

This example creates a player list on the right side of the screen and fills it with the currently connected players.

local playerList = guiCreateGridList(0.80, 0.40, 0.15, 0.35, true)
guiGridListAddColumn(playerList, "Player", 0.85)
for _, player in ipairs(getElementsByType("player")) do
guiGridListAddRow(playerList, getPlayerName(player))
end

See Also

GUI Functions