franku Posted April 12, 2015 Share Posted April 12, 2015 How i make combobox when i select 100$ and set bitton i get 100$ and 200$ and 300$ and thanks guy, i hope u help me Link to comment
Ryancit2 Posted April 12, 2015 Share Posted April 12, 2015 You can use following: guiCreateComboBox guiComboBoxGetItemText guiComboBoxGetSelected Link to comment
franku Posted April 12, 2015 Author Share Posted April 12, 2015 Pls guys example i need this i appreciate it Link to comment
Ryancit2 Posted April 12, 2015 Share Posted April 12, 2015 Simple example: addEventHandler ("onClientResourceStart",resourceRoot,function() local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 200,100 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 local vehiclesComboBox = guiCreateComboBox ( left, top, windowWidth,windowHeight, "Vehicle Names", 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("gettext", function (command) local item = guiComboBoxGetSelected(vehiclesComboBox) local text = guiComboBoxGetItemText(vehiclesComboBox, item) outputChatBox("Currently selected item with ID: " .. tostring(item) .. " and with text: " .. text) end) Now go ig, start this and type /gettext Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now