getEntityPlayerIsFreeAimingAt
GET_ENTITY_PLAYER_IS_FREE_AIMING_AT0x2975C866E6713290The GTA V native GET_ENTITY_PLAYER_IS_FREE_AIMING_AT of the PLAYER namespace, as LS:MP client scripts call it: the global function getEntityPlayerIsFreeAimingAt, in JavaScript and in Lua.
getEntityPlayerIsFreeAimingAt(player: Player): [ok: boolean, entity: Entity]getEntityPlayerIsFreeAimingAt(player: Player): boolean, EntityUsage
JavaScript
const [ok, entity] = getEntityPlayerIsFreeAimingAt(player);Lua
local ok, entity = getEntityPlayerIsFreeAimingAt(player)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
player | Player | number | integer |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | entity | Entity | number | integer | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns TRUE if it found an entity in your crosshair within range of your weapon. Assigns the handle of the target to the *entity that you pass it.
Returns false if no entity found.
Reference
- Namespace
- Player PLAYER
- In the game
BOOL GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(Player player, Entity* entity)- Hash
0x2975C866E6713290