guiComboBoxAddItem | Multi Theft Auto: Wiki Skip to content

guiComboBoxAddItem

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.


Adds an item to a combobox.

OOP Syntax Help! I don't understand this!

Syntax

int guiComboBoxAddItem ( element comboBox, string value )
Required Arguments
  • comboBox: The combobox you want to add a row to
  • value: The text that the item will contain.

Returns

  • int: value

Returns the item ID if it has been created, false otherwise.

Code Examples

shared

This Example will add an item to comboBox when player use commandaddItemfollowed by the value of the item.

addCommandHandler("addItem", function (command, value)
guiComboBoxAddItem(comboBox, value)
outputChatBox("Item with text " .. value .. " has been added!")
end)

See Also

GUI Functions