Try this
function createFileHandler (player)
myfile = xmlCreateFile("spawners.xml","spawners")
NewNode = xmlCreateChild(myfile, "spawner")
xmlSaveFile(myfile)
outputChatBox("spawners.xml has successfuly been created!", player, 0,255,0)
end
addCommandHandler ( "file", createFileHandler )
function createspawners (player)
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "lvl 5" ) ) then
local x, y, z = getElementPosition ( player )
-- local rot = getPedRotation ( player )
local int = getElementInterior ( player )
local dim = getElementDimension ( player )
local file = xmlLoadFile("spawners.xml")
if (file) then
local newChild = xmlFindChild ( file, "spawner", 0 )
xmlNodeSetAttribute ( newChild, "x", x )
xmlNodeSetAttribute ( newChild, "y", y )
xmlNodeSetAttribute ( newChild, "z", z )
xmlNodeSetAttribute ( newChild, "int", int )
xmlNodeSetAttribute ( newChild, "dim", dim )
created = createMarker (x, y, z-1, "cylinder", 2, 255, 0, 0, 200)
setElementInterior ( created, int )
outputChatBox ( "Marker has successfully been created!", player, 0, 255, 0 )
xmlSaveFile ( file )
else
outputChatBox ( "Spawners: spawners.xml has failed to load! Fixing problem now.", player, 255, 0, 0 )
xmlCreateChild(myfile, "spawner")
end
else
outputChatBox ( "Spawners: This command is only for admins!", player, 255, 0, 0 )
end
end
addCommandHandler ( "create", createspawners )