Skip to main content

Player::getProp

This function returns a prop of player from ID.

Syntax

```js let prop = player.getProp(Number propID) ```

Props:

  • 0 - Helmets, hats, earphones, masks
  • 1 - Glasses
  • 2 - Ear accessories

Example

This example output a prop from prop ID.

```js mp.events.add('playerCommand', (player, command) => {

 let arr = command.split(' ');
 if (arr[0] == 'getprop') \{
   if (arr.length < 2 || !parseInt(arr[1])) \{
     return player.outputChatBox('Use syntax: /getprop [prop_id]');
   \} else \{
     let prop = player.getProp(parseInt(arr[1]));
     player.outputChatBox('drawable: ' + prop.drawable + ' texture: ' + prop.texture);
   \}
 \}

}); ```

See also