Huh, thank you!
I use Ceeser's xmldata script to save to xml, and now with the new method the xml save does not work
i got this warning: warning: checkDataType for xmlSaveData - MTA elements should be stored since they have a temporary ID! Got userdata
wth?
this is my code:
local xml = exports.xmldata
function teszt(thePlayer)
local object=getElementsByType("object")
for element, data in pairs(menteshez) do
if not isElement(element) then
menteshez[element] = nil
end
end
for k, v in ipairs(object) do
if getElementData(v,"owner") == thePlayer then
local x,y,z = getElementPosition(v)
local id = getElementModel(v)
local int = getElementInterior(v)
local dim = getElementDimension(v)
local Rx,Ry,Rz = getElementRotation ( v )
outputChatBox("saved")
menteshez[v] = {x,y,z,id,owner,int,dim,Rx,Ry,Rz}
end
end
xml:xmlSaveData("save", menteshez, false, true)
end
addCommandHandler("save",teszt)