Entity::setOwnVariables: Difference between revisions
(Created page with "{{ServersideJsFunction}} Set multiple custom data variables that will be only available to an entity. {{JSContainer| ==Syntax== <pre> entity.setOwnVariables({'variable1': va...") |
|||
| Line 34: | Line 34: | ||
== See More == | == See More == | ||
{{Player_function}} | |||
{{Entity_functions}} | {{Entity_functions}} | ||
[[Category:Entity API]] | [[Category:Entity API]] | ||
[[Category:Server-side Function]] | [[Category:Server-side Function]] | ||
Latest revision as of 18:50, 29 May 2024
Server-Side Function
Set multiple custom data variables that will be only available to an entity.
JavaScript Syntax
Syntax
entity.setOwnVariables({'variable1': value1, 'variable2': value2});
Example
This will set the multiple values for specific player, which will only be available to him.
Server-Side
player.setOwnVariables({
'foo': 'bar',
'beast': true
});
Now variables can be used on client-side but they will be only available for player specified on server-side.
Client-Side
mp.players.local.getVariable('foo'); // 'bar'
mp.players.local.getVariable('beast'); // true
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