Player::setProp: Difference between revisions
No edit summary |
Tag: Rollback |
||
| (6 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
This function | This function sets the prop for the player | ||
== Syntax == | == Syntax == | ||
< | <pre> | ||
player.setProp( | player.setProp(propID, drawableID, textureID) | ||
</ | </pre> | ||
Props: | Props: | ||
* 0 - Helmets, hats, earphones, masks | * 0 - Helmets, hats, earphones, masks | ||
| Line 9: | Line 9: | ||
* 2 - Ear accessories | * 2 - Ear accessories | ||
* 6 - Watches | * 6 - Watches | ||
* 7 - | * 7 - Bracelets | ||
=== Parameters === | |||
*'''propID''': {{RageType|Int}} | |||
*'''drawableID''': {{RageType|Int}} | |||
*'''textureID''': {{RageType|Int}} | |||
== Example == | == Example == | ||
Creates a command called setprops which lets you try out different props | |||
< | {{ServersideCode| | ||
mp.events. | <pre> | ||
mp.events.addCommand('setprop', (player, args) => { | |||
if(!args || isNaN(args[0]) || isNaN(args[1]) || isNaN(args[2])){ | |||
return player.outputChatBox("Syntax: /setprop [propID] [drawableID] [textureID]"); | |||
} | |||
let cmd = args.split(' '); | |||
player.setProp(parseInt(cmd[0]), parseInt(cmd[1]), parseInt(cmd[2])); | |||
}); | }); | ||
</ | </pre> | ||
}} | |||
==See | ==See also== | ||
{{Player_block}} | {{Player_block}} | ||
[[Category:Player Appearance]] | |||
[[Category:Server-side Function]] | |||
Latest revision as of 00:13, 15 June 2020
This function sets the prop for the player
Syntax
player.setProp(propID, drawableID, textureID)
Props:
- 0 - Helmets, hats, earphones, masks
- 1 - Glasses
- 2 - Ear accessories
- 6 - Watches
- 7 - Bracelets
Parameters
- propID: Int
- drawableID: Int
- textureID: Int
Example
Creates a command called setprops which lets you try out different props
Server-Side
mp.events.addCommand('setprop', (player, args) => {
if(!args || isNaN(args[0]) || isNaN(args[1]) || isNaN(args[2])){
return player.outputChatBox("Syntax: /setprop [propID] [drawableID] [textureID]");
}
let cmd = args.split(' ');
player.setProp(parseInt(cmd[0]), parseInt(cmd[1]), parseInt(cmd[2]));
});
See also
- Functions
- Player::ban
- Player::call
- Player::callProc
- Player::callToStreamed
- Player::callUnreliable
- Player::cancelPendingRpc
- Player::clearDecorations
- Player::getClothes
- Player::getDecoration
- Player::getFaceFeature
- Player::getHeadBlend
- Player::getHeadOverlay
- Player::getProp
- Player::getWeaponAmmo
- Player::giveWeapon
- Player::hasPendingRpc
- Player::invoke
- Player::isStreamed
- Player::isStreamedFor
- Player::kick
- Player::kickSilent
- Player::notify
- Player::outputChatBox
- Player::playAnimation
- Player::playScenario
- Player::putIntoVehicle
- Player::removeFromVehicle
- Player::removeObject
- Player::removeWeapon
- Player::removeAllWeapons
- Player::resetWeapon
- Player::setClothes
- Player::setCustomization
- Player::setDecoration
- Player::setFaceFeature
- Player::setHairColor
- Player::setHeadBlend
- Player::setHeadOverlay
- Player::setProp
- Player::setWeaponAmmo
- Player::spawn
- Player::stopAnimation
- Player::updateHeadBlend
- Player::enableVoiceTo
- Player::disableVoiceTo
- Weapons::clear
- Entity::destroy
- Entity::dist
- Entity::distSquared
- Entity::getVariable
- Entity::setVariable
- Entity::setVariables
- Properties
- Player::action
- Player::aimTarget
- Player::allWeapons
- Player::armour
- Player::eyeColor
- Player::faceFeatures
- Player::hairColor
- Player::hairHighlightColor
- Player::heading
- Player::health
- Player::rgscId
- Player::ip
- Player::serial
- Player::isAiming
- Player::isClimbing
- Player::isEnteringVehicle
- Player::isInCover
- Player::isInMelee
- Player::isJumping
- Player::isLeavingVehicle
- Player::isOnLadder
- Player::isReloading
- Player::name
- Player::packetLoss
- Player::ping
- Player::seat
- Player::socialClub
- Player::streamedPlayers
- Player::vehicle
- Player::voiceListeners
- Player::disableOutgoingSync
- Player::weapon
- Player::weaponAmmo
- Player::weapons
- Entity::alpha
- Entity::data
- Entity::dimension
- Entity::id
- Entity::model
- Entity::position
- Entity::type