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

Ped::isPedheadshotValid

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

Syntax

<syntaxhighlight lang="javascript">mp.game.ped.isPedheadshotValid(handle);</syntaxhighlight>

Required Arguments

  • handle: int

Return value

  • int

Example

<syntaxhighlight lang="javascript"> let pedHeadShot; if (pedHeadShot == null) {

   pedHeadShot = mp.players.local.registerheadshot();
   mp.gui.chat.push(`pedHeadShot: ${pedHeadShot});

} if (mp.game.ped.isPedheadshotValid(pedHeadShot) && mp.game.ped.isPedheadshotReady(pedHeadShot)) {

   let headshotTexture = mp.game.ped.getPedheadshotTxdString(pedHeadShot);
   mp.events.add(`render`, () => {
       mp.game.graphics.drawSprite(headshotTexture, headshotTexture, 0.5, 0.5, 0.1, 0.1, 0, 255, 255, 255, 100);
   })

} </syntaxhighlight>

See also