isa_Khamdan Posted September 25, 2013 Posted September 25, 2013 Hello , I made a search bar for my gridlist and I used this code from the forums to make it work but it doesn't and there is no errors at all so can anyone tell me how can I fix it? clientsideResourceStart = function() if column then for id,playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, column, getPlayerName(playeritem), false, false) end end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) function search() guiGridListClear(GUIEditor_Grid[1]) local text = guiGetText(SearchBar) if (text == "") then for index, player in ipairs(getElementsByType("player")) do if (player ~= localPlayer) then local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, getPlayerName(player), false, false) end end else for index, player in ipairs(getElementsByType("player")) do if (player ~= localPlayer) then if string.find (string.upper(getPlayerName(player)), string.upper(text), 1, true) then local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, getPlayerName(player), false, false) end end end end end addEventHandler("onClientGUIChanged", SearchBar, search)
Castillo Posted September 25, 2013 Posted September 25, 2013 Are you sure that there are no errors? can you post the whole code?
isa_Khamdan Posted September 25, 2013 Author Posted September 25, 2013 Are you sure that there are no errors? can you post the whole code? I will post it on a PM
Castillo Posted September 25, 2013 Posted September 25, 2013 I tested it and it works, you're testing it with someone else, right? because the script is skipping the local player, so it won't show up on list.
isa_Khamdan Posted September 25, 2013 Author Posted September 25, 2013 I tested it and it works, you're testing it with someone else, right? because the script is skipping the local player, so it won't show up on list. Edit : I will test it now on my server.
isa_Khamdan Posted September 25, 2013 Author Posted September 25, 2013 It works fine I was testing it alone that's why I was getting this problem Thanks for telling me that it skip local player
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