Entity::setOwnVariable: Difference between revisions
KirillZver (talk | contribs) No edit summary |
KirillZver (talk | contribs) No edit summary |
||
| Line 15: | Line 15: | ||
=== Required Arguments === | === Required Arguments === | ||
*{{Required}}'''entity''': {{RageType|Object}} | *{{Required}}'''entity''': {{RageType|Object}} | ||
*{{Required}}''' | *{{Required}}'''key''': {{RageType|String}} | ||
*{{Required}}'''value''': {{RageType|Any}} | *{{Required}}'''value''': {{RageType|Any}} | ||
Revision as of 00:51, 2 January 2021
Server-Side Function
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