xmlSaveFile | Multi Theft Auto: Wiki Skip to content

xmlSaveFile

Client-side
Server-side
Shared

This function saves a loaded XML file.

OOP Syntax Help! I don't understand this!

Syntax

boolean xmlSaveFile ( xmlnode rootNode )
Required Arguments
  • rootNode: The root xmlnode of the loaded XML file.

Returns

  • boolean: result

Returns true if save was successful, false if the XML file does not exist.

Code Examples

client

This example allows a player to use the command 'createfile' to create an .xml file.

-- Creates a file named "new.xml" with root node "newroot" and childnode "newchild".
function createFileHandler()
local RootNode = xmlCreateFile("new.xml"," newroot")
local NewNode = xmlCreateChild(RootNode, "newchild")
xmlSaveFile(RootNode)
xmlUnloadFile(RootNode)
end
addCommandHandler("createfile", createFileHandler)