Entity::getOwnVariable: Difference between revisions
KirillZver (talk | contribs) No edit summary |
|||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
{{ServersideJsFunction}} | {{ServersideJsFunction}} | ||
{{JSContainer| | |||
Gets the value of the key set with [[Entity::setOwnVariable|player.setOwnVariable(key, value)]]. | |||
=== Required Params=== | |||
*{{Required}}'''key''': {{RageType|String}} | |||
==Syntax== | ==Syntax== | ||
<pre> | <pre> | ||
player.getOwnVariable(key); | |||
</pre> | </pre> | ||
==Example== | ==Example== | ||
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> | ||
| Line 30: | Line 25: | ||
So we get the value that we set earlier. | So we get the value that we set earlier. | ||
{{ServersideCode| | {{ServersideCode| | ||
<pre> | <pre> | ||
| Line 39: | Line 33: | ||
== 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
JavaScript Syntax
Gets the value of the key set with player.setOwnVariable(key, value).
Required Params
- *key: String
Syntax
player.getOwnVariable(key);
Example
This will set the job id for this player, which will only be available to him.
Server-Side
player.setOwnVariable("jobId", 9);
So we get the value that we set earlier.
Server-Side
player.getOwnVariable("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