FWCentral Posted May 14, 2012 Author 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
Jaysds1 Posted May 14, 2012 Posted May 14, 2012 np, I learned something today My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
CapY Posted May 14, 2012 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.
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