Entity::setOwnVariable

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Server-Side
Function

Js.png JavaScript



Sets the data available to the player as opposed to entity.setVariable(key, value).

JavaScript Syntax
Jslogo.png

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