Player::getProp

From RAGE Multiplayer Wiki

This function returns a prop of player from ID.

Syntax

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.

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