Player::getEntityIsFreeAimingAtRaw

From RAGE Multiplayer Wiki
Revision as of 09:06, 23 April 2024 by Shr0x (talk | contribs) (Created page with "{{JSContainer| ==Syntax== <syntaxhighlight lang="javascript">mp.game.player.getEntityIsFreeAimingAtRaw();</syntaxhighlight> ===Return value=== *'''handle or undefined''' ==Example== <syntaxhighlight lang="javascript"> const targetEntity = mp.game.player.getEntityIsFreeAimingAtRaw(); if (targetEntity) { const ped = mp.peds.atHandle(targetEntity); if (ped && mp.peds.exists(ped)) { mp.gui.chat.push(`You are aiming at ped id ${ped.id}`); } } </syntaxhi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

JavaScript Syntax

Syntax

mp.game.player.getEntityIsFreeAimingAtRaw();

Return value

  • handle or undefined

Example

const targetEntity = mp.game.player.getEntityIsFreeAimingAtRaw();
if (targetEntity) {
    const ped = mp.peds.atHandle(targetEntity);
    if (ped && mp.peds.exists(ped)) {
        mp.gui.chat.push(`You are aiming at ped id ${ped.id}`);
    }
}


See also