_IS_PED_LOOKING_AT_COORD
Returns true if the ped's current 'IK look-at' target is within `radius` of (x, y, z).
Hash
0x508F5053E3F6F0C4Runtime name
IsPedLookingAtCoordNamespaceTASK
SideClient
NameCommunity guess
Docs
Since build1207
Signature
BOOL _IS_PED_LOOKING_AT_COORD(Ped ped, float x, float y, float z, float radius);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
x | float | — |
y | float | — |
z | float | — |
radius | float | — |
Returns BOOL
Description
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.
Only used in R* SP Scripts
Params: p4 = 1.0f - 30.0f
Usage
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#
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());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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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
InvokeNativewith the hash — it always works.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.