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
Hash
0x06087579E7AA85A9Runtime name
IsTargetPedInPerceptionAreaNamespacePED
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x06087579E7AA85A9Signature
BOOL IS_TARGET_PED_IN_PERCEPTION_AREA(Ped ped, Ped targetPed, float p2, float customDistance, float p4, float p5);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
targetPed | Ped | — |
p2 | float | — |
customDistance | float | — |
p4 | float | — |
p5 | float | — |
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
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#
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());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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.