Entity::setVariable

From RAGE Multiplayer Wiki
Revision as of 12:19, 29 December 2017 by Mcfloy (talk | contribs) (Created page with "__NOTOC__ '''Function''': Sets a custom data into an entity. ==Syntax== <syntaxhighlight lang="javascript"> entity.setVariable(name, value); </syntaxhighlight> ==Example==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Function: Sets a custom data into an entity.

Syntax

entity.setVariable(name, value);

Example

Server-Side

// Supposed you're trying to bind a vehicle to a player, you can do this:
let veh = mp.vehicles.new(vehName, player.position);
player.setVariable('veh', veh);