XmlLoadFile

From Multi Theft Auto: Wiki
Revision as of 15:52, 20 October 2007 by ChrML (talk | contribs) (→‎Syntax)
Jump to navigation Jump to search

This function provides an alternative way to load XML files to getResourceConfig. This function loads an XML file and returns the node by specifying a specific file path, while getResourceConfig allows for loading an XML file from a resource.

Syntax

Click to collapse [-]
Server
xmlnode xmlLoadFile ( string filename, resource root = getThisResource () )              

Required Arguments

  • filename: The path to the file you wish to load. This is a path relative to the current or specified resource root directory.
Click to collapse [-]
Client
xmlnode xmlLoadFile ( string filename )              

Required Arguments

  • filename: The path to the file you wish to load. This is a path relative to the "mods\deathmatch" folder found in your MTA San Andreas installation directory..

Returns

Returns the root xmlnode object of an xml file if successful, or false otherwise.

Example

This example loads an XML file called test.xml.

node = xmlLoadFile ( "test.xml" )

See Also