Entity::getOwnVariable: Difference between revisions

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


Allows to get the value set with [[Entity::setOwnVariable|entity.setOwnVariable(key, value)]].
Allows to get the value set with [[Entity::setOwnVariable|entity.setOwnVariable(key, value)]].
Позволяет получить значение установленное с помощью  [[Entity::setOwnVariable|entity.setOwnVariable(key, value)]].


{{JSContainer|
{{JSContainer|
Line 20: Line 18:
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>
Line 30: Line 27:
So we get the value that we set earlier.
So we get the value that we set earlier.


Так мы получим значение, что установили ранее.
{{ServersideCode|
{{ServersideCode|
<pre>
<pre>

Revision as of 09:21, 4 January 2021

Server-Side
Function

 JavaScript



Allows to get the value set with entity.setOwnVariable(key, value).

JavaScript Syntax

Syntax

entity.getOwnVariable(key);

Required Arguments

  • *entity: Object
  • *key: String

Example

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

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


So we get the value that we set earlier.

Server-Side
player.getOwnVariable("jobId"); // 9


See More