Jump to content

Edit a meta.xml in a .zip resource..


Recommended Posts

Any way of doing this?

It doesn't change it at all..

local currentmapres = exports.mapmanager:getRunningGamemodeMap() 
                file = xmlLoadFile(":" ..getResourceName(currentmapres).. "/meta.xml") 
                if file ~= false then 
                    local oldmapname = xmlFindChild(file, "info", 0) 
                    if oldmapname ~= false then 
                        local newname = table.concat({...}, " ") 
                        xmlNodeSetAttribute(oldmapname, "name", newname) 
                        outputChatBox("* Map name is now '" ..newname.. "'.", g_Root, 46, 154, 254) 
                        triggerClientEvent("updateMapName", g_Root, newname) 
                        setResourceInfo(currentmapres, "name", newname) 
                        xmlSaveFile(file) 
                        xmlUnloadFile(file) 
                    end 
                end 
            end 

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