The Lab
PLAYER native

_GET_PLAYER_FREE_AIM_CLOSEST_ENTITY

returns BOOL2 paramsbuild 1207

Writes the entity closest to the free-aim reticle of player into entity, returning true if one was found.

Signature

C
BOOL _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY(Player player, Entity* entity); // 0x7AE93C45EC14A166 b1207

Parameters

#NameType
1playerPlayer
2entityEntity* (out pointer)

Facts

Facts about _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY
Name
_GET_PLAYER_FREE_AIM_CLOSEST_ENTITY
Hash
0x7AE93C45EC14A166
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, entity = Citizen.InvokeNative(0x7AE93C45EC14A166, -- _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY
  PlayerId(), -- Player player
  Citizen.PointerValueInt(), -- Entity* entity
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
const [result, entity] = Citizen.invokeNative("0x7AE93C45EC14A166", // _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY
  PlayerId(), // Player player
  Citizen.pointerValueInt(), // Entity* entity
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var entityArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x7AE93C45EC14A166, // _GET_PLAYER_FREE_AIM_CLOSEST_ENTITY
  API.PlayerId(), // Player player
  entityArg // Entity* entity
);
int entity = entityArg.GetResult<int>();
All PLAYER natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.