Entity::setOwnVariable: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
m (Undone translations)
Line 4: Line 4:


Sets the data available to the player as opposed to [[Entity::setVariable|entity.setVariable(key, value)]].
Sets the data available to the player as opposed to [[Entity::setVariable|entity.setVariable(key, value)]].
Устанавливает для игрока данные, которые доступны ему, в отличии от [[Entity::setVariable|entity.setVariable(key, value)]].


{{JSContainer|
{{JSContainer|
Line 21: Line 19:
This will set the job id for this player, which will only be available to him.
This will set the job id for this player, which will only be available to him.


Это установит id работы для данного игрока, которое будет доступно только у него.
{{ServersideCode|
{{ServersideCode|
<pre>
<pre>

Revision as of 09:22, 4 January 2021

Server-Side
Function

 JavaScript



Sets the data available to the player as opposed to 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.

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


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


See More