AddResourceConfig: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: {{Server function}} __NOTOC__ tba ==Syntax== <syntaxhighlight lang="lua"> xmlnode addResourceConfig ( resource, name, type = "server" ) </syntaxhighlight> ===Required Arguments=== <!-- List each argument one p...)
 
(Added description, fixed syntax, added argument descriptions, added return info, added categories)
Line 1: Line 1:
{{Server function}}
{{Server function}}
__NOTOC__
__NOTOC__
tba
This function adds a new empty config file to an existing resource.


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
xmlnode addResourceConfig ( resource, name, type = "server" )
xmlnode addResourceConfig ( resource theResource, string filename, [ string filetype = "server" ] )
</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 -->
*'''theResource:''' the [[resource]] to which the config file will be added.
*'''argumentName:''' description
*'''filename:''' the name of the config file to be added.


<!-- Only include this section below if there are optional arguments -->
===Optional Arguments===  
===Optional Arguments===  
{{OptionalArg}}  
{{OptionalArg}}  
*'''argumentName2:''' description
*'''filetype:''' a string indicating whether the file is serverside ("server") or clientside ("client").
*'''argumentName3:''' description


===Returns===
===Returns===
tba
Returns the new config's root [[xmlnode]] if the config was added successfully, ''false'' otherwise.


==Example==
==Example==
This function lists all loaded resources in the console.
[[Category:Needs Example]]
<syntaxhighlight lang="lua">
function blabla ()
    --this does blabla
end
</syntaxhighlight>


==See Also==
==See Also==
{{Resource_functions}}
{{Resource_functions}}
[[Category:Incomplete]]

Revision as of 10:37, 20 October 2007

This function adds a new empty config file to an existing resource.

Syntax

xmlnode addResourceConfig ( resource theResource, string filename, [ string filetype = "server" ] )

Required Arguments

  • theResource: the resource to which the config file will be added.
  • filename: the name of the config file to be added.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • filetype: a string indicating whether the file is serverside ("server") or clientside ("client").

Returns

Returns the new config's root xmlnode if the config was added successfully, false otherwise.

Example

See Also