SiN!X ~ Posted May 11, 2011 Share Posted May 11, 2011 Hello i made simple map list viewer, but the problem now ,, How i can make Map Searcher .. or Grid searcher i tried many ways and search inside this forum but i couldn't find anything useful Link to comment
Castillo Posted May 11, 2011 Share Posted May 11, 2011 Maybe you don't know how to search? viewtopic.php?f=91&t=33061&p=346697&hilit=map+search#p346697 I just searched for the word(s) "map search" and that came up. Link to comment
SiN!X ~ Posted May 11, 2011 Author Share Posted May 11, 2011 i found this .. but id didn't work .. guiGridListSetItemText(MapViewr, row, 1, tostring(name), false, false) name is Boolean value Link to comment
SiN!X ~ Posted May 11, 2011 Author Share Posted May 11, 2011 kk cc addEvent("sendMaps", true ) function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) end addEventHandler( "sendMaps", getLocalPlayer(), sendmaps ) function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( mapNameEdit, gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1 ) addEvent( "clearGridList", true ) function clearGridList() guiGridListClear( mapGridList ) end --[[ ]]-- addEventHandler("onClientGUIChanged", SearchMaps, function(mapNameEdit) local mapsearch = guiGetText(mapNameEdit) guiGridListClear(mapGridList) for i = 0, row do if string.find(tostring(name[i]), mapsearch, 1, false) then local row = guiGridListAddRow(mapGridList) guiGridListSetItemText(mapGridList, row, 1, tostring(name[i]), false, false) end end end ) do you want ServerMap.lua ? Link to comment
Castillo Posted May 11, 2011 Share Posted May 11, 2011 (edited) Hmmm, the truth is, in the topic i gave you, there isn't the full code to search as i can see, there are missing parts. Edit: Try this: mapTable = {} function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) table.insert(mapTable, {tostring(name)}) end addEvent("sendMaps", true ) addEventHandler( "sendMaps", getRootElement(), sendmaps ) function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( mapNameEdit, gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1, false ) function clearGridList() mapTable = {} guiGridListClear( mapGridList ) end addEvent( "clearGridList", true ) addEventHandler("clearGridList",getRootElement(),clearGridList) addEventHandler("onClientGUIChanged", SearchMaps, function () guiGridListClear ( mapGridList ) local text = guiGetText ( mapNameEdit ) if (text ~= "") then for i, v in ipairs (mapTable) do row = guiGridListAddRow(mapGridList) if ( string.find ( string.upper ( tostring(v[1]) ), string.upper ( text ), 1, true ) ) then guiGridListSetItemText(mapGridList, row, 1, tostring(v[1]), false, false) end end else for i, v in ipairs (mapTable) do row = guiGridListAddRow(mapGridList) guiGridListSetItemText(mapGridList, row, 1, tostring(v[1]), false, false) end end end) Edited May 11, 2011 by Guest Link to comment
SiN!X ~ Posted May 11, 2011 Author Share Posted May 11, 2011 bad Argument#1 table expected got nil table.insert(mapsTable, {tostring(name)}) i can see the map list in the Gird .. but when i search nothing appear Link to comment
Castillo Posted May 11, 2011 Share Posted May 11, 2011 My bad, i put mapsTable and it's mapTable, copy the code again. Link to comment
SiN!X ~ Posted May 11, 2011 Author Share Posted May 11, 2011 yea i noticed that ^^ Thaanks it Works Perfectly, You are the Best lua programmer Castillo ^^ 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