12p Posted December 22, 2010 Share Posted December 22, 2010 This script works fine: function createMap () if not getResourceFromName("minecraftmap") then mapResource = createResource ("minecraftmap") end mapFile = addResourceMap (":minecraftmap/map.map") return mapFile end The only problem is that meta.xml can't find the map when it is created... So I tried to do this: function createMap () if not getResourceFromName("minecraftmap") then mapResource = createResource ("minecraftmap") end mapFile = addResourceMap (":minecraftmap/map.map") removeResourceFile (mapResource,"meta.xml") local meta = xmlCreateFile (":minecraftmap/meta.xml","meta") local mapNode = xmlCreateChild (meta,"map") xmlNodeSetAttribute (mapNode,"src","map.map") xmlNodeSetAttribute (mapNode,"dimension","0") return mapFile end But nothing happens. Maybe it's a bug of MTA? PS: This is meta.xml looking when I create the map: <meta> <map src="" dimension="0" /> </meta> PS2: Can u believe this is the first time I use XML functions and map functions? Link to comment
Castillo Posted December 22, 2010 Share Posted December 22, 2010 you aren't saving the meta.xml i think. Link to comment
Castillo Posted December 22, 2010 Share Posted December 22, 2010 i think you should add xmlSaveFile(meta) in some part of script. Link to comment
12p Posted December 22, 2010 Author Share Posted December 22, 2010 LOL, that was the problem! Thanks a lot, mate =) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now