Jump to content

xml files


iron015

Recommended Posts

Excuse me for the bad English , translated by an translator

Good evening , I have on the server gradually replenishes the number of open xml files.

qDa0UBStdvs.jpg

for example:

  
function banks ( res ) 
    if res == getThisResource() then 
        xml = xmlLoadFile("data/coordinates.xml") 
        if xml then 
            children = xmlFindChild ( xml, "TERMINALPoints", 0 ) 
            if children then 
                for i,v in ipairs(xmlNodeGetChildren(children)) do 
                    x = xmlNodeGetAttribute(v,"x") 
                    y = xmlNodeGetAttribute(v,"y") 
                    z = xmlNodeGetAttribute(v,"z") 
                    r = xmlNodeGetAttribute(v,"r") 
                    bank[i] = createMarker ( x, y, z, "cylinder", 2, 255, 153, 0, 170 ) 
                    terminal[i] = createObject (1863, x, y, z, 0, 0, r) 
                end 
                xmlUnloadFile(xml) 
            end 
        end 
    end 
end 
addEventHandler ( "onResourceStart", getRootElement(), banks ) 
  

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