Entity::setOwnVariable: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 15: Line 15:
=== Required Arguments ===
=== Required Arguments ===
*{{Required}}'''entity''': {{RageType|Object}}
*{{Required}}'''entity''': {{RageType|Object}}
*{{Required}}'''name''': {{RageType|String}}
*{{Required}}'''key''': {{RageType|String}}
*{{Required}}'''value''': {{RageType|Any}}
*{{Required}}'''value''': {{RageType|Any}}



Revision as of 00:51, 2 January 2021

Server-Side
Function

 JavaScript



Sets the data available to the player as opposed to entity.setVariable(key, value).

Устанавливает для игрока данные, которые доступны ему, в отличии от entity.setVariable(key, value).

JavaScript Syntax

Syntax

entity.setOwnVariable(key, value);

Required Arguments

  • *entity: Object
  • *key: String
  • *value: Any

Example

This will set the job id for this player, which will only be available to him.

Это установит id работы для данного игрока, которое будет доступно только у него.

Server-Side
player.setOwnVariable("jobId", 9);


Client-Side
mp.players.local.getVariable("jobId"); // 9


See More