Entity::setOwnVariable
Server-Side Function
JavaScript Syntax
Sets the data available to the player as opposed to player.setVariable(key, value), the data that you set with 'setOwnVariable' is only available for the given player.
Syntax
player.setOwnVariable(key, value);
Required Arguments
- *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);
player.getOwnVariable("jobId"); //9
Client-Side
mp.players.local.getVariable("jobId"); // 9
See More
- Functions
- Player::kick
- Player::ban
- Player::spawn
- Player::giveWeapon
- Player::outputChatBox
- Player::getClothes
- Player::setClothes
- Player::getProp
- Player::setProp
- Player::putIntoVehicle
- Player::removeFromVehicle
- Player::invoke
- Player::call
- Player::notify
- Player::getHeadBlend
- Player::setHeadBlend
- Player::updateHeadBlend
- Player::setFaceFeature
- Player::getFaceFeature
- Player::setHairColour
- Player.setOwnVariable
- Player.getOwnVariable
- Player.setOwnVariables
- Properties
- Entity::id
- Entity::dimension
- Entity::type
- Player::action
- Player::name
- Player::model
- Player::alpha
- Player::position
- Player::heading
- Player::health
- Player::armour
- Player::isJumping
- Player::isInCover
- Player::isClimbing
- Player::isEnteringVehicle
- Player::isLeavingVehicle
- Player::vehicle
- Player::seat
- Player::weapon
- Player::isAiming
- Player::aimTarget
- Player::ping
- Player::ip
- Player::eyeColour
- Player::hairColour
- Player::hairHighlightColour
- Entity::destroy
- Entity::dist
- Entity::distSquared
- Entity::getVariable
- Entity::setVariable
- Entity::setVariables