# SHAPETEST::GET_SHAPE_TEST_RESULT

- **Hash:** `0xEDE8AC7C5108FB1D`
- **Namespace:** SHAPETEST
- **Runtime name (Lua/JS):** `GetShapeTestResult`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/SHAPETEST/GET_SHAPE_TEST_RESULT

## Signature

```c
int GET_SHAPE_TEST_RESULT(ScrHandle shapeTestHandle, BOOL* hit, Vector3* endCoords, Vector3* surfaceNormal, Entity* entityHit);
```

## Parameters

- `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

### Lua

```lua
local retval, hit, endCoords, surfaceNormal, entityHit = GetShapeTestResult(shapeTestHandle)

-- always available, by hash
local retval, hit, endCoords, surfaceNormal, entityHit = Citizen.InvokeNative(0xEDE8AC7C5108FB1D, shapeTestHandle, Citizen.PointerValueInt() --[[ BOOL* ]], Citizen.PointerValueVector(), Citizen.PointerValueVector(), Citizen.PointerValueInt(), Citizen.ResultAsInteger())
```

### JavaScript

```js
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());
```

### C#

```csharp
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: alloc8or RDR3 NativeDB.*
