ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. xmlSaveFile

Function

xmlSaveFile

Server and clientXMLIdentical to MTA:SA

Saves the whole document (that the node belongs to) to its file. Does not work for read-only documents or those from xmlLoadString.

Syntax

bool xmlSaveFile(xmlnode rootNode)

Arguments

rootNodexmlnode
Any node of the document (usually the root).

Returns

true when saved.

Example

local root = xmlLoadFile("settings.xml") or xmlCreateFile("settings.xml", "settings")
xmlNodeSetAttribute(root, "lastStart", os.date("%Y-%m-%d %H:%M"))
xmlSaveFile(root)
xmlUnloadFile(root)

See also