Hi ich habe mal wieder ein kleines Problem ich bekommen immer nur den letzten Eintrag der XML in der TXT aufgelistet habs mal mit nem outputChatBox probiert da werden alle Werte ausgegeben?
Lua
function datatotxt ()
if (fileExists ("output.txt") ) then
fileDelete ("output.txt")
local rootnode = xmlLoadFile("koordinaten.xml")
local children = xmlNodeGetChildren(rootnode)
for index, node in ipairs(children) do
xx = tonumber(xmlNodeGetAttribute(node, "x"))
yy = tonumber(xmlNodeGetAttribute(node, "y"))
zz = tonumber(xmlNodeGetAttribute(node, "z"))
local file = fileCreate ("output.txt")
fileWrite (file, '['..index..']="'..xx..', '..yy..', '..zz..'",')
fileClose (file)
end
end
end
addEvent ("write1", true)
addEventHandler ("write1", getRootElement(), datatotxt)
Alles anzeigen