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

Function

guiGridListGetSelectedItem

ClientInterface (GUI)Identical to MTA:SA

Returns the selected row (from 0) and column (from 1). When nothing is selected: -1, -1.

Syntax

int guiGridListGetSelectedItem(gui-gridlist gridList)

Arguments

gridListgui-gridlist
The list.

Returns

Row and column.

Example

addEventHandler("onClientGUIClick", list, function()
    local row, col = guiGridListGetSelectedItem(list)
    if row ~= -1 then
        outputChatBox(guiGridListGetItemText(list, row, col))
    end
end, false)