Jump to content

Clothes Selector (RPG) - Help!


12p

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...