Jump to content

[Help]xmlLoadFile Furniture list


#Hulk

Recommended Posts

1- Error in line 76 , 77 at argument 1 !

local screenW, screenH = guiGetScreenSize()
wnd2 = guiCreateWindow((screenW - 276) / 2, (screenH - 338) / 2, 276, 338, "Furniture System List", false)
guiWindowSetSizable(wnd2, false)
guiSetVisible(wnd2,false)
gr1 = guiCreateGridList(9, 24, 257, 231, false, wnd2)
guiGridListAddColumn(gr1, "ID", 0.5)
guiGridListAddColumn(gr1, "Name", 0.5)
getit = guiCreateButton(75, 265, 127, 28, "Get it", false, wnd2)
cl2 = guiCreateButton(75, 300, 127, 28, "Close", false, wnd2)
guiGridListSetSelectionMode(gr1,2)

node = xmlLoadFile("objects.xml") 
    for i = 0,2 do
        subnode = xmlFindSubNode(node,"model", i) 
        id = xmlNodeGetAttribute(subnode,"id") 
        name = xmlNodeGetAttribute(subnode, "name") 
        row =  guiGridListAddRow ( gr1 ) 
        guiGridListSetItemText ( gr1, row, 1,  tostring(id), false, false ) 
        guiGridListSetItemText ( gr1, row, 2,  tostring(name), false, false ) 

end

2- can i delete all furniture from homes ? i mean it's empty

Edited by #Hulk
Link to comment

Yes but you have opened xml file in variable NODE and then you getting value id and name from varible subnode but you doenst opening xml and you dont have variable subnode

 

//EDIT: Sorry i now see you have variable subnode.

Edited by arciCZ
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...