Entity::getOwnVariable: Difference between revisions
KirillZver (talk | contribs) (Created page with "__TOC__ {{ServersideJsFunction}} Allows to get the value set with entity.setOwnVariable(key, value). Позволяет получить знач...") |
KirillZver (talk | contribs) No edit summary |
||
| Line 28: | Line 28: | ||
<br> | <br> | ||
So we get the value that we set earlier. | |||
Так мы получим значение, что установили ранее. | |||
{{ServersideCode| | {{ServersideCode| | ||
<pre> | <pre> | ||
Revision as of 00:56, 2 January 2021
Server-Side Function
Allows to get the value set with entity.setOwnVariable(key, value).
Позволяет получить значение установленное с помощью 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.
Это установит id работы для данного игрока, которое будет доступно только у него.
Server-Side
player.setOwnVariable("jobId", 9);
So we get the value that we set earlier.
Так мы получим значение, что установили ранее.
Server-Side
player.getOwnVariable("jobId"); // 9