philip1994 Posted September 15, 2013 Share Posted September 15, 2013 i have an issue with guiGridList, i want to return the row of a specific column by matching a string??? Link to comment
TAPL Posted September 15, 2013 Share Posted September 15, 2013 for i=0, guiGridListGetRowCount(theList) do if guiGridListGetItemText(theList, i, theColumn) == "THE STRING HERE" then -- Your code... end end Link to comment
GamerDeMTA Posted September 15, 2013 Share Posted September 15, 2013 TAPL, I have a doubt about this too. I want to do a gridlist with 3 weapons, for example, X, Y, Z, would this work? Or your example is for other thing? for i=0, guiGridListGetRowCount(MYLIST) do if guiGridListGetItemText(MYLIST, i, COLUMN) == "X" then giveWeapon --blablabla end end ? Link to comment
philip1994 Posted September 15, 2013 Author Share Posted September 15, 2013 thanks guys, appreciate the help however ive come up with a different way from both these examples Link to comment
philip1994 Posted September 15, 2013 Author Share Posted September 15, 2013 TAPL, your method works best and is more reliable than mine, thanks a lot . Link to comment
TAPL Posted September 16, 2013 Share Posted September 16, 2013 TAPL, your method works best and is more reliable than mine, thanks a lot . You're welcome. TAPL, I have a doubt about this too. I want to do a gridlist with 3 weapons, for example, X, Y, Z, would this work? Or your example is for other thing? for i=0, guiGridListGetRowCount(MYLIST) do if guiGridListGetItemText(MYLIST, i, COLUMN) == "X" then giveWeapon --blablabla end end ? This example is looping through all rows in the grid list and then check if specific string is matching, by this way you can get the row id for the specific string in the grid list. You can for example change the text of the row or just delete it or color it or even get the text from other column within the row. So this depends on what you want to do. I assume that you have three column with multiple column selection and you wanted to get the selected item from the three column if so you will need this function: guiGridListGetSelectedItems For giveWeapon you'll need to trigger to server side. 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