GET_SHAPE_TEST_RESULT
Returns 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.
Hash
0xEDE8AC7C5108FB1DRuntime name
GetShapeTestResultNamespaceSHAPETEST
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x3D87450E15D98694Signature
int GET_SHAPE_TEST_RESULT(ScrHandle shapeTestHandle, BOOL* hit, Vector3* endCoords, Vector3* surfaceNormal, Entity* entityHit);Parameters
| Name | Type | Description |
|---|---|---|
shapeTestHandle | ScrHandle | — |
hit | BOOL* | — |
endCoords | Vector3* | — |
surfaceNormal | Vector3* | — |
entityHit | Entity* | — |
Returns int
Description
Returns 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.
When used with an asynchronous shape test, this native should be looped until returning 0 or 2, after which the handle is invalidated.
enum eShapeTestStatus
{
SHAPETEST_STATUS_NONEXISTENT,
SHAPETEST_STATUS_RESULTS_NOTREADY,
SHAPETEST_STATUS_RESULTS_READY
};Usage
local retval, hit, endCoords, surfaceNormal, entityHit = GetShapeTestResult(shapeTestHandle)
-- always works, by hash
local retval, hit, endCoords, surfaceNormal, entityHit = Citizen.InvokeNative(0xEDE8AC7C5108FB1D, shapeTestHandle, Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.PointerValueVector(), Citizen.PointerValueVector(), Citizen.PointerValueInt(), Citizen.ResultAsInteger())JavaScript and C#
const [retval, hit, endCoords, surfaceNormal, entityHit] = GetShapeTestResult(shapeTestHandle);
// by hash
const [retval, hit, endCoords, surfaceNormal, entityHit] = Citizen.invokeNative('0xEDE8AC7C5108FB1D', shapeTestHandle, Citizen.pointerValueInt() /* BOOL* */, Citizen.pointerValueVector(), Citizen.pointerValueVector(), Citizen.pointerValueInt(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());var hit = new OutputArgument();
var endCoords = new OutputArgument();
var surfaceNormal = new OutputArgument();
var entityHit = new OutputArgument();
int retval = Function.Call<int>((Hash)0xEDE8AC7C5108FB1D, shapeTestHandle, hit, endCoords, surfaceNormal, entityHit);
// hit.GetResult<bool>()
// endCoords.GetResult<Vector3>()
// surfaceNormal.GetResult<Vector3>()
// entityHit.GetResult<int>()- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.