FWCentral Posted May 14, 2012 Author Share Posted May 14, 2012 It works perfect like this; function updateLocations ( location ) for i=0, guiGridListGetRowCount(locationsList)do if isTextInGridList(locationsList, 1, location) == false then guiGridListSetItemText ( locationsList, guiGridListAddRow ( locationsList ), 1, location, false, false ) end end end With the function he added above, Thanks Jaysds1 and karthik184 awesome guys Link to comment
CapY Posted May 14, 2012 Share Posted May 14, 2012 Dunno if this will be useful or not: function isTextInGridList(gridlist,column,text) if gridlist and column and text then local rows = (guiGridListGetRowCount(gridlist) or 1) for row = 0,rows do if text == guiGridListGetItemText(gridlist, row, column) then return true end end return false end return false end Usage: isTextInGridList(locationsList, 1, "myText") -- returns true if text was found otherwise false Add to https://wiki.multitheftauto.com/wiki/Useful_Functions list. 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