# WATER::TEST_PROBE_AGAINST_ALL_WATER

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

## Signature

```c
int TEST_PROBE_AGAINST_ALL_WATER(float x1, float y1, float z1, float x2, float y2, float z2, int flags, Vector3* intersectionPos);
```

## Parameters

- `x1` (`float`)
- `y1` (`float`)
- `z1` (`float`)
- `x2` (`float`)
- `y2` (`float`)
- `z2` (`float`)
- `flags` (`int`)
- `intersectionPos` (`Vector3*`)

## Returns

`int`

## Description

enum eScriptWaterTestResult
{
	SCRIPT_WATER_TEST_RESULT_NONE,
	SCRIPT_WATER_TEST_RESULT_WATER,
	SCRIPT_WATER_TEST_RESULT_BLOCKED,
};

## Usage

### Lua

```lua
local retval, intersectionPos = TestProbeAgainstAllWater(x1, y1, z1, x2, y2, z2, flags, intersectionPos)

-- always available, by hash
local retval, intersectionPos = Citizen.InvokeNative(0x8974647ED222EA5F, x1, y1, z1, x2, y2, z2, flags, Citizen.PointerValueVector(), Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, intersectionPos] = TestProbeAgainstAllWater(x1, y1, z1, x2, y2, z2, flags, intersectionPos);

// by hash
const [retval, intersectionPos] = Citizen.invokeNative('0x8974647ED222EA5F', x1 + 0.0000001, y1 + 0.0000001, z1 + 0.0000001, x2 + 0.0000001, y2 + 0.0000001, z2 + 0.0000001, flags, Citizen.pointerValueVector(), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var intersectionPos = new OutputArgument();
int retval = Function.Call<int>((Hash)0x8974647ED222EA5F, x1, y1, z1, x2, y2, z2, flags, intersectionPos);
// intersectionPos.GetResult<Vector3>()
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.
- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.

*Sources: alloc8or RDR3 NativeDB.*
