GET_CLOSEST_POINT_ON_LINE
Returns the point on the line segment from the second to the third coordinate set that is closest to the first; p9 controls clamping to the segment.
Signature
Vector3 GET_CLOSEST_POINT_ON_LINE(float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8, BOOL p9); // 0x83ACC65D9ACEC5EF b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | p0 | float |
| 2 | p1 | float |
| 3 | p2 | float |
| 4 | p3 | float |
| 5 | p4 | float |
| 6 | p5 | float |
| 7 | p6 | float |
| 8 | p7 | float |
| 9 | p8 | float |
| 10 | p9 | BOOL |
Facts
| Name | GET_CLOSEST_POINT_ON_LINE |
|---|---|
| Hash | 0x83ACC65D9ACEC5EF |
| Namespace | |
| Returns | Vector3 |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local coords = Citizen.InvokeNative(0x83ACC65D9ACEC5EF, -- GET_CLOSEST_POINT_ON_LINE
0.0, -- float p0
0.0, -- float p1
0.0, -- float p2
0.0, -- float p3
0.0, -- float p4
0.0, -- float p5
0.0, -- float p6
0.0, -- float p7
0.0, -- float p8
false, -- BOOL p9
Citizen.ResultAsVector()
)
print(coords.x, coords.y, coords.z)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const coords = Citizen.invokeNative("0x83ACC65D9ACEC5EF", // GET_CLOSEST_POINT_ON_LINE
0.0, // float p0
0.0, // float p1
0.0, // float p2
0.0, // float p3
0.0, // float p4
0.0, // float p5
0.0, // float p6
0.0, // float p7
0.0, // float p8
false, // BOOL p9
Citizen.resultAsVector()
);
const [x, y, z] = coordsVector3 coords = Function.Call<Vector3>((Hash)0x83ACC65D9ACEC5EF, // GET_CLOSEST_POINT_ON_LINE
0.0f, // float p0
0.0f, // float p1
0.0f, // float p2
0.0f, // float p3
0.0f, // float p4
0.0f, // float p5
0.0f, // float p6
0.0f, // float p7
0.0f, // float p8
false // BOOL p9
);Related MISC natives
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.