guiGridListClear | Multi Theft Auto: Wiki Skip to content

guiGridListClear

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function clears all the data from a grid list.

Syntax

guiGridListClear ( )

Code Examples

client

This creates a player list and then clears it when a button is clicked:

-- create the grid list
local playerList = guiCreateGridList(0.80, 0.40, 0.15, 0.35, true)
guiGridListAddColumn(playerList, "#", 0.15)
guiGridListAddColumn(playerList, "Player", 0.75)
-- fill the grid list with player names
for index, player in ipairs(getElementsByType("player")) do
guiGridListAddRow(playerList, index, getPlayerName(player))
end
-- create a button to clear the grid list
local clearButton = guiCreateButton(0.80, 0.30, 0.15, 0.05, "Clear list", true)
-- when the button is clicked, clear the grid list
addEventHandler("onClientGUIClick", clearButton, function()
guiGridListClear(playerList)
end)

See Also

GUI Functions