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

Function

xmlDestroyNode

Server and clientXMLIdentical to MTA:SA

Removes a node together with its children. The root node cannot be removed.

Syntax

bool xmlDestroyNode(xmlnode theXMLNode)

Arguments

theXMLNodexmlnode
The node to remove.

Returns

true when removed.

Example

local root = xmlLoadFile("bans.xml")
for _, ban in ipairs(xmlNodeGetChildren(root)) do
    if xmlNodeGetAttribute(ban, "serial") == "ABC123" then xmlDestroyNode(ban) end
end
xmlSaveFile(root)
xmlUnloadFile(root)

See also