12p Posted October 20, 2010 Share Posted October 20, 2010 I'm making a Clothes Selector for RPG servers. I will add it to the community resources when it's ended But now I need some help. Well, I'm trying to delete all gridlist's rows, then adding new ones. The problem is that it just delete SOME rows. Why it doesn't delete all? Here are the lines: headClothes = {{"Default","player_face","head","1"},{"Bald","bald","head","1"},{"Bald and Beard","baldbeard","head","1"},{"Bald and Moustache","baldtash","head","1"},{"Bald and Goatee","baldgoatee","head","1"},{"Wedge","wedge","wedge","1"},{"Slope Hair","slope","slope","1"},{"Curly","jhericurl","jheri","1"},{"Groove Cut","groovecut","groovecut","1"}} headGrid = guiCreateGridList(0.0466,0.0764,0.9067,0.8917,true,headWindow) guiGridListAddColumn(headGrid,"Name",0.6) guiGridListAddColumn(headGrid,"ID 1",0.2) guiGridListAddColumn(headGrid,"ID 2",0.2) guiGridListAddColumn(headGrid,"ID 3",0.2) for i = 0, guiGridListGetRowCount(headGrid) do guiGridListRemoveRow (headGrid,i) end end if source == head then for i,v in ipairs (headClothes) do local row = guiGridListAddRow (headGrid) guiGridListSetItemText (headGrid,row,1,v[1],false,false) guiGridListSetItemText (headGrid,row,2,v[2],false,false) guiGridListSetItemText (headGrid,row,3,v[3],false,false) guiGridListSetItemText (headGrid,row,4,v[4],false,false) end PS: I can post whole script, but may be a too lazy way for you. PS2: If you want to help me with this script to make it more efficient, post it Link to comment
Castillo Posted October 20, 2010 Share Posted October 20, 2010 maybe you could use xml to make it easier (thats what i think) i think would be much faster to script/edit it. Link to comment
dzek (varez) Posted October 20, 2010 Share Posted October 20, 2010 maybe this https://wiki.multitheftauto.com/wiki/GuiGridListClear Link to comment
12p Posted October 20, 2010 Author Share Posted October 20, 2010 maybe you could use xml to make it easier (thats what i think) i think would be much faster to script/edit it. ... Not bad idea I will use it. maybe thishttps://wiki.multitheftauto.com/wiki/GuiGridListClear TY varez! TY so much! PS: hahaha I never write "Varez" 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