START_SHAPE_TEST_LOS_PROBE
Starts an asynchronous ray (line of sight) test; read it with GET_SHAPE_TEST_RESULT.
0x7EE9F5D83DD4F90EStartShapeTestLosProbe0x7EE9F5D83DD4F90ESTART_SHAPE_TEST_RAYSignature
ScrHandle START_SHAPE_TEST_LOS_PROBE(float x1, float y1, float z1, float x2, float y2, float z2, int flags, Entity entity, int p8);Parameters
| Name | Type | Description |
|---|---|---|
x1 | float | — |
y1 | float | — |
z1 | float | — |
x2 | float | — |
y2 | float | — |
z2 | float | — |
flags | int | — |
entity | Entity | — |
p8 | int | — |
Returns ScrHandle
Description
Asynchronously starts a line-of-sight (raycast) world probe shape test.
Use the handle with 0x3D87450E15D98694 or 0x65287525D951F6BE until it returns 0 or 2.
p8 is a bit mask with bits 1, 2 and/or 4, relating to collider types; 4 should usually be used.
Asynchronously starts a line-of-sight (raycast) world probe shape test.
Use the handle with 0x3D87450E15D98694 or 0x65287525D951F6BE until it returns 0 or 2.
p8 is a bit mask with bits 1, 2 and/or 4, relating to collider types; 4 should usually be used. flags used are mostly 83 and 3167
Verified notes
Reviewed in this portal's repository · by borderline-rp
The RedM runtime exposes this native as StartShapeTestRay (the older name), with the same arguments.
Flags and animals
The usual "world + vehicles + peds + objects" mask (1|2|4|8|16) hits human peds but not animals — horses included. Bit 4 does not cover animal peds. Use -1 to hit everything, then filter the entity yourself.
local handle = StartShapeTestRay(from.x, from.y, from.z, to.x, to.y, to.z, -1, PlayerPedId(), 0)
local _, hit, endCoords, _, entity = GetShapeTestResult(handle)Verified in game on the Borderline RP server (third-eye targeting on horses), September 2026.
Usage
local retval = StartShapeTestLosProbe(x1, y1, z1, x2, y2, z2, flags, entity, p8)
-- always works, by hash
local retval = Citizen.InvokeNative(0x7EE9F5D83DD4F90E, x1, y1, z1, x2, y2, z2, flags, entity, p8, Citizen.ResultAsInteger())JavaScript and C#
const retval = StartShapeTestLosProbe(x1, y1, z1, x2, y2, z2, flags, entity, p8);
// by hash
const retval = Citizen.invokeNative('0x7EE9F5D83DD4F90E', x1 + 0.0000001, y1 + 0.0000001, z1 + 0.0000001, x2 + 0.0000001, y2 + 0.0000001, z2 + 0.0000001, flags, entity, p8, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0x7EE9F5D83DD4F90E, x1, y1, z1, x2, y2, z2, flags, entity, p8);- 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.
See also
START_EXPENSIVE_SYNCHRONOUS_SHAPE_TEST_LOS_PROBEDoes the same as 0x7EE9F5D83DD4F90E, except blocking until the shape test completes.GET_SHAPE_TEST_RESULTReturns the result of a shape test: 0 if the handle is invalid, 1 if the shape test is still pending, or 2 if the shape test has completed, and the handle should be invalidated.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives · RedM Natives (verified notes)
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.