ÆBKV Posted December 28, 2017 Share Posted December 28, 2017 (edited) -- not the whole code -- vehicles = {{411},{451},{506}} v_editbox = guiCreateEdit(10,10,150,30,"Search",false,v_tab) for _,vehicle in ipairs(vehicles) do local vehicleName = getVehicleNameFromID(weapon[1]) local w_row = guiGridListAddRow(w_gridlist) guiGridListSetItemText(w_gridlist,w_row,1,weaponName,false,false) end Hello guys, how can I search for vehicles from the Grid List? I have specially created an editbox where the players can search for vehicles. (v_editbox) In the table I created are the vehicles Infernus, Turismo and Super GT. So if I write in, for example, "Infernus", is only Infernus in the Grid List. Can someone help me please? Edited December 28, 2017 by ÆBKV Link to comment
ميدوح Posted December 28, 2017 Share Posted December 28, 2017 try: vehicles = {{411},{451},{506}} v_editbox = guiCreateEdit(10,10,150,30,"Search",false,v_tab) for _,vehicle in ipairs(vehicles) do local id = getElementModel ( vehicle[1] ) local vehicleName = string.find ( string.upper (getVehicleName(id) ), string.upper ( guiGetText ( v_editbox ) ), 1, true ) local w_row = guiGridListAddRow(w_gridlist) guiGridListSetItemText(w_gridlist,w_row,1,tostring(vehicleName),false,false) end 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