Перейти к содержанию

Player::getProp

Материал из RAGE MP Wiki Archive

This function returns a prop of player from ID.

Syntax

<syntaxhighlight lang="javascript"> let prop = player.getProp(Number propID) </syntaxhighlight> Props:

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

Example

This example output a prop from prop ID. <syntaxhighlight lang="javascript"> 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);
   }
 }

}); </syntaxhighlight>

See also