GetResourceConfig: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
<!-- Describe in plain english what this function does. Don't go into details, just give an overview -->
This function is used to return the root node of a configuration file. Config files must be predefined in a resource's [[meta file]].
This function is used to return the root node of a configuration file. (defined in meta.xml)


==Syntax==  
==Syntax==  
<!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
xmlnode getResourceConfig ( resource theResource, string filename )
xmlnode getResourceConfig ( [resource theResource = getThisResource()], string filename )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
<!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type -->
*'''filename:''' The exact file name of the configuration file. (e.g. "file.xml" )
 
===Optional Arguments===
*'''theResource:''' The resource from which the function calls the configuration file
*'''theResource:''' The resource from which the function calls the configuration file
*'''filename:''' The exact file name of the configuration file. (e.g. "file.xml" )


===Returns===
===Returns===
<!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check -->
Returns the root node of the specified configuration file. If the file is corrupted, not defined in the meta file or doesn't exist, returns false.
Returns the root node of the specified configuration file. If the file is corrupted, not defined in meta.xml or doesn't exist, returns false.


==Example==  
==Example==  


==See Also==
==See Also==
<!-- Change FunctionArea to the area that this function is in on the main function list page, e.g. Server, Player, Vehicle etc -->
{{Resource_functions}}
{{FunctionArea_functions}}
[[Category:Incomplete]]
[[Category:Incomplete]]

Revision as of 00:51, 15 June 2007

This function is used to return the root node of a configuration file. Config files must be predefined in a resource's meta file.

Syntax

xmlnode getResourceConfig ( [resource theResource = getThisResource()], string filename )

Required Arguments

  • filename: The exact file name of the configuration file. (e.g. "file.xml" )

Optional Arguments

  • theResource: The resource from which the function calls the configuration file

Returns

Returns the root node of the specified configuration file. If the file is corrupted, not defined in the meta file or doesn't exist, returns false.

Example

See Also

Shared