Player::setProp: Difference between revisions
(Created page with "This function set prop for player. == Syntax == <syntaxhighlight lang="javascript"> player.setProp(Number propID, Number drawable, Number texture) </syntaxhighlight> Props: *...") |
No edit summary |
||
| Line 8: | Line 8: | ||
* 1 - Glasses | * 1 - Glasses | ||
* 2 - Ear accessories | * 2 - Ear accessories | ||
== Example == | |||
This example changes props. | |||
<syntaxhighlight lang="javascript"> | |||
mp.events.add('playerCommand', (player, command) => { | |||
let arr = command.split(' '); | |||
if (arr[0] == 'setprop') { | |||
if (arr.length < 4 || !parseInt(arr[1]) || !parseInt(arr[2]) || !parseInt(arr[3])) { | |||
return player.outputChatBox('Use syntax: /setprop [prop_id] [drawable_id] [texture_id]'); | |||
} else { | |||
player.setProp(parseInt(arr[1]), parseInt(arr[2]), parseInt(arr[3])); | |||
} | |||
} | |||
}); | |||
</syntaxhighlight> | |||
Revision as of 18:52, 4 January 2017
This function set prop for player.
Syntax
player.setProp(Number propID, Number drawable, Number texture)
Props:
- 0 - Helmets, hats, earphones, masks
- 1 - Glasses
- 2 - Ear accessories
Example
This example changes props.
mp.events.add('playerCommand', (player, command) => {
let arr = command.split(' ');
if (arr[0] == 'setprop') {
if (arr.length < 4 || !parseInt(arr[1]) || !parseInt(arr[2]) || !parseInt(arr[3])) {
return player.outputChatBox('Use syntax: /setprop [prop_id] [drawable_id] [texture_id]');
} else {
player.setProp(parseInt(arr[1]), parseInt(arr[2]), parseInt(arr[3]));
}
}
});