Entity::getVariable: Difference between revisions

From RAGE Multiplayer Wiki
Line 5: Line 5:
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
value entity.getVariable(name);
value entity.getVariable(name); // Returns null if key 'name' does not exist.
</syntaxhighlight>
</syntaxhighlight>



Revision as of 13:11, 11 March 2018


Function: Gets a custom data from an entity.

Syntax

value entity.getVariable(name); // Returns null if key 'name' does not exist.

Example

Server-Side

// Supposed you want to get a vehicle you bound with a player
let veh = player.getVariable('veh');