- Documentation
- Server functions
- addResourceConfig
Function
addResourceConfig
Adds a config file (<config src type>) to the meta.xml of a resource – your own, or one this script created with createResource. Adding the same file twice changes nothing.
Syntax
bool addResourceConfig(resource theResource, string filePath [, string fileType = "server"])Arguments
theResourceresource- The resource.Different type in MTA:SA: string filePath
filePathstring- The file path.Optional in MTA:SA: string filetype = "server"
fileTypestring, optional = "server""server"or"client".Not in MTA:SA
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
addResourceConfig(string filePath, string filetype = "server")Returns
true on success.
Example
addResourceConfig(getThisResource(), "ustawienia.xml", "server")
See also
getResourceConfigOpens a resource's XML config file (e.g.<config src="settings.xml"/>frommeta.xml) and returns its root node. Read it with thexml*functions and close it withxmlUnloadFileat the end.addResourceMapAdds a map file (<map src dimension>) to themeta.xmlof a resource – your own, or one this script created withcreateResource. The map loads the next time the resource starts.