RedM Natives

_GET_PLAYER_FREE_AIM_CLOSEST_ENTITY

Returns true if any entity have been found closest to where the player is aiming at (like 5m max far).

Hash0x7AE93C45EC14A166
Runtime nameGetPlayerFreeAimClosestEntity
NamespacePLAYER
SideClient
NameCommunity guess
Docs
Since build1207

Signature

BOOL _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY(Player player, Entity* entity);

Parameters

NameTypeDescription
playerPlayer—
entityEntity*—

Returns BOOL

Description

alloc8or RDR3 NativeDB

Returns true if any entity have been found closest to where the player is aiming at (like 5m max far). Seems to only work on human peds

Parameters:
- entity: Entity* - Pointer of closest entity.

Returns:
- success: bool - True if entity found, false otherwise.

Example video:
- https://imgur.com/a/JiqTmYl

VORPCORE RDR3natives

Only used in script function PROCESS_PED_INTERRUPT_DIALOGUE
_GET_PLAYER_*

Usage

Lua
local retval, entity = GetPlayerFreeAimClosestEntity(player, entity)

-- always works, by hash
local retval, entity = Citizen.InvokeNative(0x7AE93C45EC14A166, player, Citizen.PointerValueIntInitialized(entity), Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, entity] = GetPlayerFreeAimClosestEntity(player, entity);

// by hash
const [retval, entity] = Citizen.invokeNative('0x7AE93C45EC14A166', player, Citizen.pointerValueIntInitialized(entity), Citizen.returnResultAnyway());
C#
var entity = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x7AE93C45EC14A166, player, entity);
// entity.GetResult<int>()
  • The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB · VORPCORE RDR3natives

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.