guiComboBoxSetItemText | Multi Theft Auto: Wiki Skip to content

guiComboBoxSetItemText

Client-side
Server-side
Shared

Manual Review Required

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


This function changes the text of a combobox item.

OOP Syntax Help! I don't understand this!

Syntax

bool guiComboBoxSetItemText ( element comboBox, int itemId, string text )
Required Arguments
  • comboBox: The combobox containing the item you're interested in
  • itemId: The index of the item
  • text: The text you want to put in (does NOT accept numbers, use tostring() for that)

Returns

  • bool: value

Returns true if the text was set successfully, false otherwise.

Code Examples

shared

This changes the text of the selected item using commandsetText.

addCommandHandler("setText",
function(cmd, text)
local item = guiComboBoxGetSelected(comboBox)
guiComboBoxSetItemText(comboBox, item, text)
end)

See Also

GUI Functions