Difference between revisions of "Entity::getVariable"

From RAGE Multiplayer Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
 +
{{SharedFunctionJS}}
 +
 
Retrieves the custom data from the entity.
 
Retrieves the custom data from the entity.
  
 +
{{JSContainer|
 
==Syntax==
 
==Syntax==
 
<pre>
 
<pre>
Line 9: Line 13:
 
==Example==
 
==Example==
 
This example will retrieve the data from the variable 'veh' that is assigned to the player
 
This example will retrieve the data from the variable 'veh' that is assigned to the player
<div class="header" style="background-color: #00baad; color: #FFFFFF; border: 2px solid #00baad;">
+
{{SharedCode|
<div style="margin: 10px 10px 10px 10px;"><b>Shared</b></div>
 
 
<pre>
 
<pre>
 
let veh = player.getVariable('veh');
 
let veh = player.getVariable('veh');
 
</pre>
 
</pre>
 
</div>
 
</div>
 +
}}
 +
}}
  
 
== See More ==
 
== See More ==

Revision as of 12:33, 2 December 2019


Shared
Function

Js.png JavaScript


Retrieves the custom data from the entity.

JavaScript Syntax
Jslogo.png

Syntax

entity.getVariable('variableName');

Example

This example will retrieve the data from the variable 'veh' that is assigned to the player

Shared
let veh = player.getVariable('veh');


See More