Player::isFreeAimingAtEntity: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Gets a value indicating whether the specified player is currently aiming freely at the specified entity.
{{JSContainer|
==Syntax==
 
<syntaxhighlight lang="javascript">mp.game.player.isPlayerFreeAimingAtEntity(entity);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''entity:''' Entity handle or object
*'''target''' Handle
===Return value===
===Return value===
*'''Boolean'''
*'''boolean'''
 
==Syntax==
<syntaxhighlight lang="javascript">
mp.game.player.isFreeAimingAtEntity(target)
</syntaxhighlight>
 
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const targetPed = mp.peds.atRemoteId(1);
if (!targetPed || !mp.peds.exists(targetPed)) return;
 
if (mp.game.player.isFreeAimingAtEntity(targetPed.handle)) {
    mp.gui.chat.push("You are aiming at ped remote id 1!")
}
 
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Player_s_function_c}}
{{Player_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 20:50, 22 April 2024

JavaScript Syntax


Required Arguments

  • target Handle

Return value

  • boolean

Syntax

mp.game.player.isFreeAimingAtEntity(target)

Example

const targetPed = mp.peds.atRemoteId(1);
if (!targetPed || !mp.peds.exists(targetPed)) return;

if (mp.game.player.isFreeAimingAtEntity(targetPed.handle)) {
    mp.gui.chat.push("You are aiming at ped remote id 1!")
}


See also