<?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=Saatanikk</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=Saatanikk"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Saatanikk"/>
	<updated>2026-04-06T18:20:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:EntityData&amp;diff=73705</id>
		<title>Resource:EntityData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:EntityData&amp;diff=73705"/>
		<updated>2022-01-20T10:51:06Z</updated>

		<summary type="html">&lt;p&gt;Saatanikk: /* getAllEntityData */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:10px; border-radius:2px;font-size:14px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Name''': entityData&lt;br /&gt;
&lt;br /&gt;
'''Developer''': [[User:GalAnonim]] (Rick)&lt;br /&gt;
&lt;br /&gt;
'''State''': &amp;lt;span style=&amp;quot;color:#55FF55;text-shadow:black 0em 0em 0.3em;&amp;quot;&amp;gt;OpenSource&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''GitHub Source''': https://github.com/httpRick/entityData/tree/main&lt;br /&gt;
&lt;br /&gt;
'''Current Version''': 1.0.0 &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The system of non-standard data operation for Elements on the MTA SA platform replaces ElementData&lt;br /&gt;
&lt;br /&gt;
==Exported functions==&lt;br /&gt;
&lt;br /&gt;
===setEntityData===&lt;br /&gt;
This function passes user information about the element to entity Data, the data can be created by the server but you should avoid passing data from client to server when assigning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function encrypts the data of the file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string exports.entityData:setEntityData(element/table theElement, var/table key, var value, [string type=&amp;quot;public&amp;quot;, int transaction])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element theElement:''' The element/elements you wish to attach the data to.&lt;br /&gt;
*'''var key:''' The key/keys you wish to store the data under.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''string type:'''  type of data synchronization&lt;br /&gt;
** ''&amp;quot;public&amp;quot;'' - Synchronizes between the server and the client, and between the client and the server (required to be enabled in the options)&lt;br /&gt;
** ''&amp;quot;local&amp;quot;'' - It does not synchronize, it remains on the side on which it was given&lt;br /&gt;
** ''&amp;quot;private&amp;quot;'' - Assigns and synchronizes one value for a given key for all items&lt;br /&gt;
*'''int transaction:''' - The transaction number, if this value is provided, the data transfer will not be executed immediately&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the data was set succesfully, false otherwise.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===getEntityData===&lt;br /&gt;
This function retrieves entity data attached to an element under a certain key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function encrypts the data of the file&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string exports.entityData:getEntityData(element/table theElement, var/table key, [string type=&amp;quot;public&amp;quot;])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element theElement:''' This is the element/elements with data you want to retrieve.&lt;br /&gt;
*'''var key:''' The name/names of the entity data entry you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''string type:''' type of data synchronization&lt;br /&gt;
** ''&amp;quot;public&amp;quot;'' - Synchronizes between the server and the client, and between the client and the server (required to be enabled in the options)&lt;br /&gt;
** ''&amp;quot;local&amp;quot;'' - It does not synchronize, it remains on the side on which it was given&lt;br /&gt;
** ''&amp;quot;private&amp;quot;'' - Assigns and synchronizes one value for a given key for all items&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a variable/tables containing the requested entity data, or false if the element/elements or the entity data does not exist.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===getAllEntityData===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function returns a table of all entity data of an element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string exports.entityData:getAllEntityData(element/table theElement, [string type=&amp;quot;public&amp;quot;])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element theElement:''' This is the element/elements with data you want to retrieve.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''string type:''' type of data synchronization&lt;br /&gt;
** ''&amp;quot;public&amp;quot;''&lt;br /&gt;
** ''&amp;quot;local&amp;quot;''&lt;br /&gt;
** ''&amp;quot;private&amp;quot;''&lt;br /&gt;
** ''&amp;quot;all&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If successful, returns a table with as keys the names of the entity data and as values the corresponding entity data values. Returns false in case of failure.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===hasEntityData===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function checks if an element has entity data available under a certain key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean exports.entityData:hasEntityData(element/table theElement, var/table key, [string type=&amp;quot;public&amp;quot;])&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''element theElement:''' This is the element/elements with data you want to retrieve.&lt;br /&gt;
*'''var key:''' The name/names of the entity data entry you want to check for. &lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''string type:'''type of data synchronization&lt;br /&gt;
** ''&amp;quot;public&amp;quot;'' - Synchronizes between the server and the client, and between the client and the server (required to be enabled in the options)&lt;br /&gt;
** ''&amp;quot;local&amp;quot;'' - It does not synchronize, it remains on the side on which it was given&lt;br /&gt;
** ''&amp;quot;private&amp;quot;'' - Assigns and synchronizes one value for a given key for all items&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns true if the element contains entity data for key, or false if the element doesn't exist or there is no data associated with the key.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===setKeyFlag===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function imposes restrictions on the key which, if not satisfied, will not perform the entity data assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean exports.entityData:setKeyFlag(var key, table flag)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''var key:''' The name of the entity data entry you want to check for. &lt;br /&gt;
*'''table flag:''' A flag containing all the [https://wiki.multitheftauto.com/wiki/Resource:EntityData/restrictions_key restrictions key]&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the flag is set and false if the flag is not set on the key.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===createTransaction===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function creates instructions for the data transfer in the form of a transaction that must be accepted or canceled.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int exports.entityData:createTransaction()&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the index of a new transaction created&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===triggerTransaction===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This function acceptance of the transaction for sending must be created beforehand, unless you send the instruction itself in the form of an array, then no transaction is needed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string exports.entityData:triggerTransaction(int transaction/table transaction)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int transaction:''' - The transaction number, if this value is provided, the data transfer will not be executed &lt;br /&gt;
*'''table transaction:''' - An table with the instruction to be executed to setEntityData&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true on valid transaction other than false&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===cancelTransaction===&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This feature will cancel the transaction and will not allow it to be submitted correctly.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;boolean exports.entityData:cancelTransaction(int transaction)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''int transaction:''' - The transaction number, if this value is provided, the data transfer will not be executed immediately&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true on valid transaction other than false&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;/div&gt;</summary>
		<author><name>Saatanikk</name></author>
	</entry>
</feed>