<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.rage.mp/w/index.php?action=history&amp;feed=atom&amp;title=Entity%3A%3AsetVariables</id>
	<title>Entity::setVariables - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rage.mp/w/index.php?action=history&amp;feed=atom&amp;title=Entity%3A%3AsetVariables"/>
	<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Entity::setVariables&amp;action=history"/>
	<updated>2026-06-05T03:33:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.rage.mp/w/index.php?title=Entity::setVariables&amp;diff=19509&amp;oldid=prev</id>
		<title>MrPancakers2: Created page with &quot;{{ServersideJsFunction}}  Set multiple custom data variables to an entity.  {{JSContainer| ==Syntax== &lt;pre&gt; entity.setVariables({&#039;variable1&#039;: value1, &#039;variable2&#039;: value2}); &lt;/...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.rage.mp/w/index.php?title=Entity::setVariables&amp;diff=19509&amp;oldid=prev"/>
		<updated>2020-04-16T04:15:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{ServersideJsFunction}}  Set multiple custom data variables to an entity.  {{JSContainer| ==Syntax== &amp;lt;pre&amp;gt; entity.setVariables({&amp;#039;variable1&amp;#039;: value1, &amp;#039;variable2&amp;#039;: value2}); &amp;lt;/...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{ServersideJsFunction}}&lt;br /&gt;
&lt;br /&gt;
Set multiple custom data variables to an entity.&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
entity.setVariables({&amp;#039;variable1&amp;#039;: value1, &amp;#039;variable2&amp;#039;: value2});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
This creates a vehicle and sets multiple variables upon creation&lt;br /&gt;
&lt;br /&gt;
{{ServersideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mp.events.addCommand(&amp;#039;car&amp;#039;, (player) =&amp;gt; {&lt;br /&gt;
    mp.vehicles.new(mp.joaat(&amp;#039;turismor&amp;#039;), player.position);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
mp.events.add(&amp;quot;entityCreated&amp;quot;, (entity) =&amp;gt; {&lt;br /&gt;
    if(entity.type === &amp;quot;vehicle&amp;quot;){&lt;br /&gt;
        entity.setVariables({&lt;br /&gt;
            &amp;quot;miles&amp;quot;: 0,&lt;br /&gt;
            &amp;quot;fuel&amp;quot;: 100&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See More ==&lt;br /&gt;
{{Entity_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Entity API]]&lt;br /&gt;
[[Category:Server-side Function]]&lt;/div&gt;</summary>
		<author><name>MrPancakers2</name></author>
	</entry>
</feed>