RedM Natives

IS_TARGET_PED_IN_PERCEPTION_AREA

Returns true if ped is in perception (focused and looking at target ped) Most float params are -1.f in R* Scripts

Hash0x06087579E7AA85A9
Runtime nameIsTargetPedInPerceptionArea
NamespacePED
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x06087579E7AA85A9

Signature

BOOL IS_TARGET_PED_IN_PERCEPTION_AREA(Ped ped, Ped targetPed, float p2, float customDistance, float p4, float p5);

Parameters

NameTypeDescription
pedPed—
targetPedPed—
p2float—
customDistancefloat—
p4float—
p5float—

Returns BOOL

Description

Returns true if ped is in perception (focused and looking at target ped)
Most float params are -1.f in R* Scripts

Usage

Lua
local retval = IsTargetPedInPerceptionArea(ped, targetPed, p2, customDistance, p4, p5)

-- always works, by hash
local retval = Citizen.InvokeNative(0x06087579E7AA85A9, ped, targetPed, p2, customDistance, p4, p5, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = IsTargetPedInPerceptionArea(ped, targetPed, p2, customDistance, p4, p5);

// by hash
const retval = Citizen.invokeNative('0x06087579E7AA85A9', ped, targetPed, p2 + 0.0000001, customDistance + 0.0000001, p4 + 0.0000001, p5 + 0.0000001, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0x06087579E7AA85A9, ped, targetPed, p2, customDistance, p4, p5);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Sources

alloc8or RDR3 NativeDB

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