guiComboBoxClear | Multi Theft Auto: Wiki Skip to content

guiComboBoxClear

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 removes all the items from a combobox.

Syntax

guiComboBoxClear ( )

Code Examples

client

This example creates a combo box with all server vehicles on it, with a command to clear the combo box.

addEventHandler ( "onClientResourceStart", resourceRoot,
function ( )
vehiclesComboBox = guiCreateComboBox ( 400, 100, 200, 5 * #getElementsByType ( "vehicle" ), "", false ) -- We create a combo box.
for index, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- We loop through all vehicles.
guiComboBoxAddItem ( vehiclesComboBox, getVehicleName ( vehicle ) ) -- We add the vehicle name to our combo box.
end
end
)
addCommandHandler ( "clear",
function ( )
guiComboBoxClear ( vehiclesComboBox ) -- We clear our combo box removing all vehicles.
end
)

See Also

GUI Functions