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

Function

getResourceConfig

ServerResourcesIdentical to MTA:SA

Opens a resource's XML config file (e.g. <config src="settings.xml"/> from meta.xml) and returns its root node. Read it with the xml* functions and close it with xmlUnloadFile at the end.

Syntax

xmlnode getResourceConfig(string filePath)

Arguments

filePathstring
The file path in the resource.

Returns

The root node or false.

Example

local config = getResourceConfig("ustawienia.xml")
if config then
    local start = xmlFindChild(config, "start", 0)
    outputServerLog("Pieniądze na start: " .. tostring(start and xmlNodeGetAttribute(start, "money")))
    xmlUnloadFile(config)
end

See also