RedM Natives

_IS_PED_LOOKING_AT_COORD

Returns true if the ped's current 'IK look-at' target is within `radius` of (x, y, z).

Hash0x508F5053E3F6F0C4
Runtime nameIsPedLookingAtCoord
NamespaceTASK
SideClient
NameCommunity guess
Docs
Since build1207

Signature

BOOL _IS_PED_LOOKING_AT_COORD(Ped ped, float x, float y, float z, float radius);

Parameters

NameTypeDescription
pedPed—
xfloat—
yfloat—
zfloat—
radiusfloat—

Returns BOOL

Description

alloc8or RDR3 NativeDB

Returns true if the ped's current 'IK look-at' target is within radius of (x, y, z). This checks the active look-at point (head/eyes) not LOS or heading and returns false if the ped has no active look-at target. Typical radius range: 1.0-30.0.

VORPCORE RDR3natives

Only used in R* SP Scripts
Params: p4 = 1.0f - 30.0f

Usage

Lua
local retval = IsPedLookingAtCoord(ped, x, y, z, radius)

-- always works, by hash
local retval = Citizen.InvokeNative(0x508F5053E3F6F0C4, ped, x, y, z, radius, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = IsPedLookingAtCoord(ped, x, y, z, radius);

// by hash
const retval = Citizen.invokeNative('0x508F5053E3F6F0C4', ped, x + 0.0000001, y + 0.0000001, z + 0.0000001, radius + 0.0000001, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0x508F5053E3F6F0C4, ped, x, y, z, radius);
  • 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.
  • 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.