Jump to content

How to dump my element tree?


mrvicio

Recommended Posts

Posted

You can view a live (serverside) element tree with the elementbrowser resource. Just start 'elementbrowser', go to the server's webpage and click on "Element browser".

If you really want Lua code, something like this (untested):

RootNode = xmlCreateFile("dump.xml"," root") 
RootElement = getRootElement() 
  
function dumpNode ( element, node ) 
    for name, value in pairs( getAllElementData(element) ) do 
        xmlNodeSetAttribute(node, name, tostring(value)) 
    end 
    for _,child in ipairs(getElementChildren(element)) do 
        dumpNode ( child, xmlCreateChild(node, getElementType(element)) ) 
    end 
end 
  
dumpNode ( RootElement, RootNode ) 

  • MTA Team
Posted

saveMapData

This converts a set of elements in the element tree into XML. This is a format that can then be loaded as a map file. Each element represents a single XML node

CANN WORK FOR THINGS OTHER THAN MAPS ;)

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