guiComboBoxGetSelected | Multi Theft Auto: Wiki Skip to content

guiComboBoxGetSelected

Client-side
Server-side
Shared

Pair: guiComboBoxSetSelected

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 returns the index of the selected combobox item.

Syntax

guiComboBoxGetSelected ( )

Code Examples

client

This example outputs selected item's text and ID to the chat.

addCommandHandler("getSelected",
function (command)
local item = guiComboBoxGetSelected(comboBox)
local text = guiComboBoxGetItemText(comboBox, item)
outputChatBox("Currently selected item with ID: " .. tostring(item) .. " and with text: " .. text)
end)

See Also

GUI Functions