GET_WATER_HEIGHT
Checks against a global variable that is set by _SET_WORLD_WATER_TYPE.
Hash
0xFCA8B23F28813F69Runtime name
GetWaterHeightNamespaceWATER
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xF6829842C06AE524Signature
BOOL GET_WATER_HEIGHT(float x, float y, float z, float* height);Parameters
| Name | Type | Description |
|---|---|---|
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
local retval, height = GetWaterHeight(x, y, z, height)
-- always works, by hash
local retval, height = Citizen.InvokeNative(0xFCA8B23F28813F69, x, y, z, Citizen.PointerValueFloatInitialized(height), Citizen.ReturnResultAnyway())JavaScript and C#
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());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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.