Player::getClothes: Difference between revisions
No edit summary |
No edit summary |
||
| Line 21: | Line 21: | ||
* texture - ID of texture. | * texture - ID of texture. | ||
* palette - ID of palette. | * palette - ID of palette. | ||
== Example == | |||
<syntaxhighlight lang="javascript"> | |||
mp.events.add('playerCommand', (player, command) => { | |||
let arr = command.split(' '); | |||
if (arr[0] == 'getclothes') { | |||
if (!parseInt(arr[1]) { | |||
player.outputChatBox('Use syntax: /getclothes [component_id]'); | |||
} else { | |||
let clothes = player.getClothes(parseInt(arr[1])); | |||
player.outputChatBox(clothes); | |||
} | |||
} | |||
}); | |||
</syntaxhighlight> | |||
Revision as of 17:12, 4 January 2017
This function return a hash of player clothes.
Syntax
Object player.getClothes(Number componentNumber);
List of components:
- 0 - Head
- 1 - Beard
- 2 - Hair
- 3 - Torso
- 4 - Legs
- 5 - Hands
- 6 - Foot
- 7 - None?
- 8 - Accessories like parachute, scuba tank
- 9 - Accessories like bags, mask, scuba mask
- 10- Decals and mask
- 11 - Auxiliary parts for torso
Object keys:
- drawable - ID of clothing.
- texture - ID of texture.
- palette - ID of palette.
Example
mp.events.add('playerCommand', (player, command) => {
let arr = command.split(' ');
if (arr[0] == 'getclothes') {
if (!parseInt(arr[1]) {
player.outputChatBox('Use syntax: /getclothes [component_id]');
} else {
let clothes = player.getClothes(parseInt(arr[1]));
player.outputChatBox(clothes);
}
}
});