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

Player::registerheadshot

Материал из RAGE MP Wiki Archive
Версия от 16:59, 28 ноября 2019; imported>YnnhoJ (Fixed example code.)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Syntax

<syntaxhighlight lang="javascript">player.registerheadshot();</syntaxhighlight>

Required Arguments

Return value

  • int

Example

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

mp.events.add('render', () => {
    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)) {
        const headshotTexture = mp.game.ped.getPedheadshotTxdString(pedHeadShot);
	
        mp.game.graphics.drawSprite(headshotTexture, headshotTexture, 0.5, 0.5, 0.1, 0.1, 0, 255, 255, 255, 100);
    }
});


See also