ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. loadMapData

Function

loadMapData

ServerMapsIdentical to MTA:SA

Creates elements (vehicles, objects, markers, pickups...) from an XML map node in .map format. Returns the map root element; destroying it removes the whole map.

Syntax

element loadMapData(xmlnode node, element parent)

Arguments

nodexmlnode
The XML node with the map.
parentelement
The parent for the map.

Returns

The map root or false.

Example

local xml = xmlLoadFile("maps/stadion.map")
local map = loadMapData(xml, resourceRoot)
xmlUnloadFile(xml)

addCommandHandler("usunmape", function()
    destroyElement(map)
end)

See also