Entity::setOwnVariable: Difference between revisions
KirillZver (talk | contribs) No edit summary |
MrPancakers2 (talk | contribs) 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)]]. | ||
{{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. | ||
{{ServersideCode| | {{ServersideCode| | ||
<pre> | <pre> | ||
Revision as of 09:22, 4 January 2021
Server-Side Function
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