guiGridListGetColumnCount | Multi Theft Auto: Wiki Skip to content

guiGridListGetColumnCount

Client-side
Server-side
Shared

This allows you to get the count of existing columns in a gridlist.

OOP Syntax Help! I don't understand this!

  • Method:gui-gridlist:getColumnCount(...)
  • Variable: .columnCount

Syntax

int|false guiGridListGetColumnCount ( ​gui-gridlist gridList )
Required arguments
  • gridList: The grid list whose columns you want to count.

Returns

Returns an integer with the amount of columns in the gridlist, false otherwise.

  • int|false: column count

Code Examples

client
-- create the grid list
local list = guiCreateGridList(0.80, 0.40, 0.15, 0.35, true)
-- add three columns to the grid list
guiGridListAddColumn(list, "Column 1", 0.33)
guiGridListAddColumn(list, "Column 2", 0.33)
guiGridListAddColumn(list, "Column 3", 0.33)
-- display the number of columns in the grid list in the debug (/debugscript 3)
print("Number of columns: " .. guiGridListGetColumnCount(list))

See Also

GUI Functions