<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ceeser</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ceeser"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Ceeser"/>
	<updated>2026-05-10T16:49:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64327</id>
		<title>XmlDeleteData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64327"/>
		<updated>2019-09-13T16:36:14Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides a way of deleting a [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper deletion you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the deletion as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only delete the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we have created a resourceProtected-only file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, false, true) -- not serverProtected, but resourceProtected&lt;br /&gt;
-- OR&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, 1) -- securityLevel 1 equals not serverProtected, unencrypted, but resouceProtected - the encryption bool will be ignored at xmlDeleteData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Template:Shared_xml_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64326</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64326"/>
		<updated>2019-09-13T16:36:05Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Template:Shared_xml_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64325</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64325"/>
		<updated>2019-09-13T16:35:54Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Template:Shared_xml_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64324</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64324"/>
		<updated>2019-09-13T16:35:42Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.1'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
'''Note: You have to put all the files of the .zip into a folder called &amp;quot;xmlData&amp;quot; and then upload the folder to your server!'''&amp;lt;br&amp;gt;&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=16187 MTA Community Page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{Template:Shared_xml_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Shared_xml_functions&amp;diff=64323</id>
		<title>Template:Shared xml functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Shared_xml_functions&amp;diff=64323"/>
		<updated>2019-09-13T16:30:24Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[xmlCopyFile]]&lt;br /&gt;
*[[xmlCreateChild]]&lt;br /&gt;
*[[xmlCreateFile]]&lt;br /&gt;
*[[xmlDestroyNode]]&lt;br /&gt;
*[[xmlFindChild]]&lt;br /&gt;
*[[xmlLoadFile]]&lt;br /&gt;
{{New items|3.0160|1.5.7|&lt;br /&gt;
*[[xmlLoadString]]&lt;br /&gt;
|19626}}&lt;br /&gt;
*[[xmlNodeGetAttribute]]&lt;br /&gt;
*[[xmlNodeGetAttributes]]&lt;br /&gt;
*[[xmlNodeGetChildren]]&lt;br /&gt;
*[[xmlNodeGetName]]&lt;br /&gt;
*[[xmlNodeGetParent]]&lt;br /&gt;
*[[xmlNodeGetValue]]&lt;br /&gt;
*[[xmlNodeSetAttribute]]&lt;br /&gt;
*[[xmlNodeSetName]]&lt;br /&gt;
*[[xmlNodeSetValue]]&lt;br /&gt;
*[[xmlSaveFile]]&lt;br /&gt;
*[[xmlUnloadFile]]&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
*[[xmlSaveData]]&lt;br /&gt;
*[[xmlLoadData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64322</id>
		<title>XmlDeleteData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64322"/>
		<updated>2019-09-13T16:30:01Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides a way of deleting a [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper deletion you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the deletion as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only delete the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we have created a resourceProtected-only file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, false, true) -- not serverProtected, but resourceProtected&lt;br /&gt;
-- OR&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, 1) -- securityLevel 1 equals not serverProtected, unencrypted, but resouceProtected - the encryption bool will be ignored at xmlDeleteData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64321</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64321"/>
		<updated>2019-09-13T16:29:39Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64320</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64320"/>
		<updated>2019-09-13T16:29:18Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64319</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64319"/>
		<updated>2019-09-13T16:28:36Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.1'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
'''Note: You have to put all the files of the .zip into a folder called &amp;quot;xmlData&amp;quot; and then upload the folder to your server!'''&amp;lt;br&amp;gt;&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=16187 MTA Community Page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64318</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64318"/>
		<updated>2019-09-13T16:25:49Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.1'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
'''Note: You have to put all the files of the .zip into a folder called &amp;quot;xmlData&amp;quot; and then upload the folder to your server!'''&amp;lt;br&amp;gt;&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=16187 MTA Community Page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlSaveData]]&lt;br /&gt;
*[[xmlLoadData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64317</id>
		<title>XmlDeleteData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64317"/>
		<updated>2019-09-13T16:25:17Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides a way of deleting a [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper deletion you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the deletion as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only delete the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we have created a resourceProtected-only file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, false, true) -- not serverProtected, but resourceProtected&lt;br /&gt;
-- OR&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, 1) -- securityLevel 1 equals not serverProtected, unencrypted, but resouceProtected - the encryption bool will be ignored at xmlDeleteData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
*[[xmlSaveData]]&lt;br /&gt;
*[[xmlLoadData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64313</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64313"/>
		<updated>2019-09-13T13:30:59Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.1'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
'''Note: You have to put all the files of the .zip into a folder called &amp;quot;xmlData&amp;quot; and then upload the folder to your server!'''&amp;lt;br&amp;gt;&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=16187 MTA Community Page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64312</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64312"/>
		<updated>2019-09-13T13:30:37Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.1'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
'''Note: You have to put all the files of the .zip into a folder called &amp;quot;xmlData&amp;quot; and then upload the folder to your server!'''&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=16187 MTA Community Page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64310</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64310"/>
		<updated>2019-09-13T12:51:38Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: Added resource download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.0'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/index.php?p=resources&amp;amp;s=details&amp;amp;id=16187 MTA Community Page].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64309</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64309"/>
		<updated>2019-09-13T12:37:54Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background: #F9F9F9; border: 1px solid #AAA; padding: 5px; width: 250px; float:right;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;|'''xmlData v1.0'''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |{{#if: {{{image|}}}|{{{image}}}}}&lt;br /&gt;
|-&lt;br /&gt;
|'''Status:'''&lt;br /&gt;
|Up to date&lt;br /&gt;
|-&lt;br /&gt;
|'''Latest Release:'''&lt;br /&gt;
|13.09.2019&lt;br /&gt;
|-&lt;br /&gt;
|'''Working on:'''&lt;br /&gt;
|MTA v1.5.7&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64308</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64308"/>
		<updated>2019-09-13T11:37:43Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64307</id>
		<title>XmlDeleteData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlDeleteData&amp;diff=64307"/>
		<updated>2019-09-13T11:37:17Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: Added xmlDeleteData&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides a way of deleting a [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper deletion you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the deletion as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only delete the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlDeleteData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to delete.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only delete the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' and a debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlDeleteData will auto-search for and delete the key of encrypted files.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we have created a resourceProtected-only file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, false, true) -- not serverProtected, but resourceProtected&lt;br /&gt;
-- OR&lt;br /&gt;
xml:xmlDeleteData(&amp;quot;settings&amp;quot;, 1) -- securityLevel 1 equals not serverProtected, unencrypted, but resouceProtected - the encryption bool will be ignored at xmlDeleteData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
*[[xmlSaveData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64306</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64306"/>
		<updated>2019-09-12T19:07:44Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
*[[xmlLoadData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64305</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64305"/>
		<updated>2019-09-12T19:07:26Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
*[[xmlSaveData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64304</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64304"/>
		<updated>2019-09-12T19:07:03Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
*[[xmlSaveData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64303</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64303"/>
		<updated>2019-09-12T19:06:34Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
*[[xmlData]]&lt;br /&gt;
*[[xmlLoadData]]&lt;br /&gt;
*[[xmlDeleteData]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64302</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64302"/>
		<updated>2019-09-12T19:03:34Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64301</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64301"/>
		<updated>2019-09-12T18:56:04Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
{{Shared_xml_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64300</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64300"/>
		<updated>2019-09-12T18:54:22Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64299</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64299"/>
		<updated>2019-09-12T18:52:55Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{XML_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64298</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64298"/>
		<updated>2019-09-12T18:51:18Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64297</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64297"/>
		<updated>2019-09-12T18:50:24Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Functions]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64296</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64296"/>
		<updated>2019-09-12T18:49:59Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful_Function]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64295</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64295"/>
		<updated>2019-09-12T18:49:46Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Useful Function]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64294</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64294"/>
		<updated>2019-09-12T18:32:19Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Resource]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64293</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64293"/>
		<updated>2019-09-12T18:30:47Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;br /&gt;
[[Resource:XmlData]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64292</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64292"/>
		<updated>2019-09-12T18:29:40Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;br /&gt;
[[Resource:XmlData]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64291</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64291"/>
		<updated>2019-09-12T18:29:05Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;removeNamespaceName&amp;gt;&amp;lt;/removeNamespaceName&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Resource:XmlData]]&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64290</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64290"/>
		<updated>2019-09-12T18:28:37Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;removeNamespaceName&amp;gt;&amp;lt;/removeNamespaceName&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource|{{XmlData}}]]&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64289</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64289"/>
		<updated>2019-09-12T18:26:18Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;br /&gt;
[[Resource:XmlData]]&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64288</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64288"/>
		<updated>2019-09-12T18:23:23Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64287</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64287"/>
		<updated>2019-09-12T18:22:36Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64286</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64286"/>
		<updated>2019-09-12T18:19:11Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64285</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64285"/>
		<updated>2019-09-12T18:18:21Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData -- PAGE FOLLOWS]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
'''This resource will save everything, no matter what you give as data input.'''&amp;lt;br&amp;gt;&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64284</id>
		<title>XmlData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlData&amp;diff=64284"/>
		<updated>2019-09-12T18:17:42Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;resource&amp;quot; subcaption=&amp;quot;Resource&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INFO ==&lt;br /&gt;
'''The documentation about this resource and its functions is not complete yet and will be continued (12.09.19)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resource Information ==&lt;br /&gt;
This resource let you save and load data in an [[XML]] File.&amp;lt;br&amp;gt;&lt;br /&gt;
It's an easy to use resource, providing 3 exported functions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
Download can be found at the [https://community.multitheftauto.com/ MTA community page -- LINK FOLLOWS].&amp;lt;br&amp;gt;&lt;br /&gt;
Resource developed by: [https://community.multitheftauto.com/index.php?p=profile&amp;amp;id=477820 Ceeser]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exported functions ==&lt;br /&gt;
'''Note: These functions are available for Server and Client'''&lt;br /&gt;
* [[XmlSaveData|xmlSaveData]]&lt;br /&gt;
* [[xmlLoadData|xmlLoadData -- PAGE FOLLOWS]]&lt;br /&gt;
* [[xmlDeleteData|xmlDeleteData -- PAGE FOLLOWS]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
Next to the point of easy access this resource has its focus on security.&lt;br /&gt;
You can specify how much protection you want to have for your data:&lt;br /&gt;
* '''Server protection''' - With this only the server that has created the file will be able to read/modify/delete it.&lt;br /&gt;
* '''Encryption''' - With this the stored data will be encrypted by a generated key, making it unreadable and unmodifyable by humans.&lt;br /&gt;
* '''Resource protection''' - With this only the resource that has created the file will be able to read/modify/delete it.&lt;br /&gt;
&lt;br /&gt;
Note: No matter what settings you use - no server will have access to any file without its specific filename.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key generation / Data encryption ===&lt;br /&gt;
If you want to save your data encrypted the script will generate a random key and stores it, so that the file can get read again.&lt;br /&gt;
If you enable server protection for the file, the key can also only be read by the same server that has generated the data file.&lt;br /&gt;
The same also goes for the resource protection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Security Levels ===&lt;br /&gt;
Instead of manually adding bool parameters to the functions you can also just pass the security level you want to use for each function:&lt;br /&gt;
* '''0''' - No protection (any server, any resource or humans could read/modify)&lt;br /&gt;
* '''1''' - Very low protection (creator resource on any server or humans could read/modify)&lt;br /&gt;
* '''2''' - Very low protection (any resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''3''' - Low protection (only creator resource on any server could read/modify, humans cant)&lt;br /&gt;
* '''4''' - Medium protection (any resource on the creator server or humans could read/modify) - DEFAULT&lt;br /&gt;
* '''5''' - Medium protection (only creator resource on the creator server or humans could read/modify)&lt;br /&gt;
* '''6''' - High protection (any resource on the creator server could read/modify, humans cant)&lt;br /&gt;
* '''7''' - Very high protection (only creator resource on creator server could read/modify, humans cant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Simplifying the export ==&lt;br /&gt;
For simplifying reasons I recommend the use this shortcut variable to call the exported functions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData -- Define this variable at the top of your script&lt;br /&gt;
&lt;br /&gt;
-- And then use it like this for example:&lt;br /&gt;
xml:xmlSaveData(&amp;quot;yourFileName&amp;quot;, yourData)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variables and Specified Names ==&lt;br /&gt;
In the exported functions are some names which I will explain here to keep the function pages as clean and small as possible.&lt;br /&gt;
&lt;br /&gt;
=== serverProtected / Creator-Server ===&lt;br /&gt;
With '''creator-server''' I mean the server that has created a file.&lt;br /&gt;
So if a file is serverProtected only the server that called the function is able to read/modify/delete it.&amp;lt;br&amp;gt;&lt;br /&gt;
This includes client-side: The function call have been on the client-side of any server, so the link to the server exist anyways.&lt;br /&gt;
&lt;br /&gt;
=== resourceProtected / Creator-Resource ===&lt;br /&gt;
With '''creator-resource''' I mean the resource that has created a file.&lt;br /&gt;
Example how it works: If you call xmlSaveData with resourceProtection from resource &amp;quot;login&amp;quot;, only &amp;quot;login&amp;quot; will then be able to read that xml file.&amp;lt;br&amp;gt;&lt;br /&gt;
If you don't use serverProtection in combination to this, every &amp;quot;login&amp;quot; resource on any server COULD read that file if it calls xmlLoadData with the correct file name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data type warning ==&lt;br /&gt;
This resource will save everything, no matter what you give as data input.&lt;br /&gt;
So be sure that there is no userdata stored inside the table you are passing to the xmlSaveData function.&lt;br /&gt;
In case you have any kind of userdata it will output warnings in the debugscript - you should fix that by removing all userdata from the input table, because: Any Userdata is temporary. It will change after a script restart, reconnect, server restart.. or even while a resource is running/ you are playing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Resource]]&amp;lt;/includeonnly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64283</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64283"/>
		<updated>2019-09-12T18:15:38Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64282</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64282"/>
		<updated>2019-09-12T18:14:30Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to load.&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64281</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64281"/>
		<updated>2019-09-12T18:13:50Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64280</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64280"/>
		<updated>2019-09-12T18:13:36Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans / securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64279</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64279"/>
		<updated>2019-09-12T18:13:06Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans/securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which your data is stored at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64278</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64278"/>
		<updated>2019-09-12T18:11:46Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''For proper data loading you need to pass the same booleans/securityLevel as you did on xmlSaveData.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''If you called [[xmlSaveData]] with passing the securityLevel its recommended to pick securityLevel as function paremeter for the loading as well.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool serverProtected = true, bool resourceProtected = false ] )&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel = 4 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( string fileName [, bool resourceProtected ] )&lt;br /&gt;
bool xmlLoadData ( string fileName [, int securityLevel ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64277</id>
		<title>XmlSaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlSaveData&amp;diff=64277"/>
		<updated>2019-09-12T18:10:59Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call it, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool serverProtected = true, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' the script will protect the file so, that can only the creator server can access it.'''&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption!'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
*'''data:''' The data you want to save (must be a table!)&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64276</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64276"/>
		<updated>2019-09-12T18:06:13Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call this function, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''If you used [[xmlSaveData]] with passing the securityLevel I recommend to pick securityLevel as function argument here as well.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''For proper data loading you need to pass the same booleans/securityLevel as you did on xmlSaveData.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( fileName [, serverProtected, resourceProtected ] )&lt;br /&gt;
bool xmlLoadData ( fileName [, int securityLevel ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( fileName [, resourceProtected ] )&lt;br /&gt;
bool xmlLoadData ( fileName [, int securityLevel ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note1: There is no encryption parameter, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
'''Note2: There is no serverProtected parameter, because its server-side already anyways.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64275</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64275"/>
		<updated>2019-09-12T18:04:02Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call this function, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''If you used [[xmlSaveData]] with passing the securityLevel I recommend to pick securityLevel as function argument here as well.'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''For proper data loading you need to pass the same booleans/securityLevel as you did on xmlSaveData.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( fileName [, serverProtected, resourceProtected ] )&lt;br /&gt;
bool xmlLoadData ( fileName [, int securityLevel ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file of the creator-server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( fileName [, resourceProtected ] )&lt;br /&gt;
bool xmlLoadData ( fileName [, int securityLevel ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file of the creator-resource, otherwise it doesn't care which resource created it.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing the files data, an empty ''table'' if there is no data stored inside the file, ''false'' and debug output in case if failure.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Lets assume we created a encrypted, serverProtected file called &amp;quot;settings&amp;quot; already.&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; true) -- serverProtected is true, resourceProtected false - false doesnt need to get passed here&lt;br /&gt;
-- OR you can do this:&lt;br /&gt;
local tblSettings = xml:xmlLoadData(&amp;quot;settings&amp;quot; 6) -- securityLevel 6 equals serverProtected, encrypted, not resouceProtected - the encryption bool will be ignored at xmlLoadData&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64274</id>
		<title>XmlLoadData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=XmlLoadData&amp;diff=64274"/>
		<updated>2019-09-12T17:53:42Z</updated>

		<summary type="html">&lt;p&gt;Ceeser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#228B22&amp;quot; subcaption=&amp;quot;Useful Function - Shared&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Useful Functions]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Important Note|&lt;br /&gt;
This is an unofficial MTA function, so its not included into the game by default.&amp;lt;br&amp;gt;&lt;br /&gt;
Its an exported function of the [[xmlData]] resource.&amp;lt;br&amp;gt;&lt;br /&gt;
To access this function you need to have the resource running on your server.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function provides an automated way of loading your data from an [[XML]] file created by [[xmlSaveData]] &amp;lt;br&amp;gt;&lt;br /&gt;
To call this function, see the [[call]] function or the tip in this resources page: [https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Simplifying the export]&lt;br /&gt;
&lt;br /&gt;
= Info =&lt;br /&gt;
'''If you used [[xmlSaveData]] with passing the securityLevel I recommend to pick securityLevel as function argument here as well.'''&lt;br /&gt;
'''For proper data loading you need to pass the same booleans/securityLevel as you did on xmlSaveData.'''&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlLoadData ( fileName [, serverProtected, resourceProtected ] )&lt;br /&gt;
bool xmlLoadData ( fileName [, int securityLevel] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''serverProtected:''' If set to ''true'' it can only read the file created by the same server, otherwise it doesn't care which server created it.&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' it can only read the file created by the caller-resource&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, bool encryptData = false, bool resourceProtected = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool xmlSaveData ( string fileName, table data [, int securityLevel = 4] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Required Arguments====&lt;br /&gt;
*'''fileName:''' The name of the file you want to create&lt;br /&gt;
&lt;br /&gt;
====Optional Arguments====&lt;br /&gt;
*'''encryptData:''' If set to ''true'' the script will generate a random key and use it to encrypt your stored data. '''Note: If you want to store &amp;quot;sensitive data&amp;quot;, always use encryption! (Account data should never be stored in serverside files - use a database instead!)'''&lt;br /&gt;
*'''resourceProtected:''' If set to ''true'' the script will add the sourceResource name (so the name of the resource from which it got called) to the fileName, preventing it from getting read/overwritten/deleted by any other resource. If set to ''false'' you can use this script to call/send/modify tables from different resources without the use of events/other export functions.&lt;br /&gt;
or&lt;br /&gt;
*'''securityLevel:''' The level of security on which you want to store your data at. (Details on the resource page: [https://wiki.multitheftauto.com/wiki/XmlData#Security_Levels Security Levels])&lt;br /&gt;
&lt;br /&gt;
'''See [https://wiki.multitheftauto.com/wiki/XmlData#Variables_and_Specified_Names xmlData Variables and Specified names] for more detail.'''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
'''Note: There is no encryption parameter in this function, because xmlLoadData will load and use a files key if it is encrypted.'''&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This is the script where we specify the export shortcut and the data table which we want to store.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local xml = exports.xmlData&lt;br /&gt;
local tblScriptSettings = {posX = 800, posY = 500, sizeX = 500, sizeY = 300, settings = {show = true, tab = 1}}&lt;br /&gt;
&lt;br /&gt;
xml:xmlSaveData(&amp;quot;myFileName&amp;quot;, tblScriptSettings , true, true) -- Save the data as &amp;quot;myFileName&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create a server-protected, encrypted file on the clients computer called &amp;quot;myFileName.xml&amp;quot;. Also it will generate a random generated key and stores it.&amp;lt;br&amp;gt;&lt;br /&gt;
The created file will -(could, because encrypted with a random key)- like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;root posY=&amp;quot;VgEN0+TERhg=&amp;quot; posX=&amp;quot;mjX4Tj5u6oM=&amp;quot; sizeX=&amp;quot;VgEN0+TERhg=&amp;quot; sizeY=&amp;quot;htgOMaZurQQ=&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;settings show=&amp;quot;yeiNs/ne1Ks=&amp;quot; tab=&amp;quot;OpijtdPvYqQ=&amp;quot;&amp;gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ceeser</name></author>
	</entry>
</feed>