Jump to content

SEARCH FOR ITEMS FROM GRID LIST


ÆBKV

Recommended Posts

-- 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 by ÆBKV
Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...