Entity::data: Difference between revisions

From RAGE Multiplayer Wiki
(Clearification about setVariable and entity.data)
mNo edit summary
Line 1: Line 1:
This property is used to get or set entity data.
This property is used to get or set entity data.


<del>'''FALSE''': Changing this property has the same effect as using [[Entity::setVariable|entity.setVariable]] function.<br></del>
If you use setVariable you have to use getVariable to get results. e.g. You can't do entity.setVariable('foo','bar') and get the result with entity.data.foo as getter. You can do so clientside, but not serverside.
'''TRUE''': if you use setVariable you have to use getVariable to get results. e.g. you can't do entity.setVariable('foo','bar') and get the result with entity.data.foo as getter. You can do so clientside, but not serverside.


== Property Type(s) & Attribute(s) ==
== Property Type(s) & Attribute(s) ==
Line 9: Line 8:


== Example(s) ==
== Example(s) ==
{{ServerSide}}
The code below is an example about how to set a entity data by directly manipulating its "data" attribute.
The code below is an example about how to set a entity data by directly manipulating its "data" attribute.


<syntaxhighlight lang="javascript">
{{ServersideCode|
<pre>
entity.data.foo = bar;
entity.data.foo = bar;
</syntaxhighlight>
</pre>
}}

Revision as of 22:08, 21 December 2018

This property is used to get or set entity data.

If you use setVariable you have to use getVariable to get results. e.g. You can't do entity.setVariable('foo','bar') and get the result with entity.data.foo as getter. You can do so clientside, but not serverside.

Property Type(s) & Attribute(s)

  • Getter - attribute should be in any format.
  • Setter - attribute should be in any format.

Example(s)

The code below is an example about how to set a entity data by directly manipulating its "data" attribute.

Server-Side
entity.data.foo = bar;