karlis Posted April 22, 2010 Share Posted April 22, 2010 addCommandHandler("move",function(_,_,mapname,x,y,z) local ticks = getTickCount() local map = xmlLoadFile(mapname..".map") local file = xmlCopyFile(map,mapname.."_Moved.map") xmlUnloadFile(map) local nodes = xmlNodeGetChildren(file) for k,v in ipairs (nodes) do xmlNodeSetAttribute(v,"posX",xmlNodeGetAttribute(v,"posX")+x) xmlNodeSetAttribute(v,"posY",xmlNodeGetAttribute(v,"posY")+y) xmlNodeSetAttribute(v,"posZ",xmlNodeGetAttribute(v,"posZ")+z) end xmlSaveFile(file) xmlUnloadFile(file) print("MapMove: Moving \""..mapname..".map\" done in "..getTickCount()-ticks.." miliseconds with "..#nodes.." elements !") end) things that are fine: -file, nodes, and map is proper elements/tables -loop is entered -output is fine and with proper values, like it should be -no errors now the problem: map is not saving, adding it manually before didnt help, too. Link to comment
PacMan Posted April 23, 2010 Share Posted April 23, 2010 This is bug http://bugs.mtasa.com/view.php?id=5301 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