# WATER::GET_WATER_HEIGHT

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

## Signature

```c
BOOL GET_WATER_HEIGHT(float x, float y, float z, float* height);
```

## Parameters

- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `height` (`float*`)

## Returns

`BOOL`

## Description

Checks against a global variable that is set by _SET_WORLD_WATER_TYPE. If that is set to one it will fail. Likely not the only issue but part of it.

## Usage

### Lua

```lua
local retval, height = GetWaterHeight(x, y, z, height)

-- always available, by hash
local retval, height = Citizen.InvokeNative(0xFCA8B23F28813F69, x, y, z, Citizen.PointerValueFloatInitialized(height), Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, height] = GetWaterHeight(x, y, z, height);

// by hash
const [retval, height] = Citizen.invokeNative('0xFCA8B23F28813F69', x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueFloatInitialized(height), Citizen.returnResultAnyway());
```

### C#

```csharp
var height = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xFCA8B23F28813F69, x, y, z, height);
// height.GetResult<float>()
```

- 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.*
