Jump to content

Problem with Loading XML Line!


SirniNamaz

Recommended Posts

Client:

function eventFiveSec() 
    if (guiGetVisible(guiEventManager) == true) then 
        local xmlElements = xmlLoadFile("elements.xml") 
        guiGridListClear(grdElementsList) 
        for i=0,149 do 
            local xmlOldChild = xmlFindChild(xmlElements,"element",i) 
            outputChatBox(xmlOldChild) 
            local attrs = xmlNodeGetAttributes(xmlOldChild) 
            outputChatBox(i) 
            if (attrs == false) then 
                return 
            else 
                local newRow = guiGridListAddRow(grdElementsList) 
                for name,value in pairs(attrs) do 
                    outputChatBox(name .. " = " .. value) 
                end 
            end 
        end 
        xmlUnloadFile(xmlElements) 
    end 
end 

XML:

    "6447187" type="weapon" item="4" x="2474.0759277344" y="-1653.5537109375" z="13.46875" left="1">
    "5859401" type="weapon" item="4" x="0" y="0" z="0" left="0">
    "1829493" type="weapon" item="4" x="2477.142578125" y="-1662.857421875" z="13.336080551147" left="1">

  

Problem: xmlOldChild is always returned as false

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...