RedM Natives

TEST_VERTICAL_PROBE_AGAINST_ALL_WATER

Checks against a global variable that is set by _SET_WORLD_WATER_TYPE.

Hash0x2B3451FA1E3142E2
Runtime nameTestVerticalProbeAgainstAllWater
NamespaceWATER
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x2B3451FA1E3142E2

Signature

int TEST_VERTICAL_PROBE_AGAINST_ALL_WATER(float x, float y, float z, int flags, float* waterHeight);

Parameters

NameTypeDescription
xfloat—
yfloat—
zfloat—
flagsint—
waterHeightfloat*—

Returns int

Description

Checks against a global variable that is set by _SET_WORLD_WATER_TYPE. If it's set to 1 (Guarma) it will fail.

See TEST_PROBE_AGAINST_ALL_WATER.

Usage

Lua
local retval, waterHeight = TestVerticalProbeAgainstAllWater(x, y, z, flags, waterHeight)

-- always works, by hash
local retval, waterHeight = Citizen.InvokeNative(0x2B3451FA1E3142E2, x, y, z, flags, Citizen.PointerValueFloatInitialized(waterHeight), Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, waterHeight] = TestVerticalProbeAgainstAllWater(x, y, z, flags, waterHeight);

// by hash
const [retval, waterHeight] = Citizen.invokeNative('0x2B3451FA1E3142E2', x + 0.0000001, y + 0.0000001, z + 0.0000001, flags, Citizen.pointerValueFloatInitialized(waterHeight), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var waterHeight = new OutputArgument();
int retval = Function.Call<int>((Hash)0x2B3451FA1E3142E2, x, y, z, flags, waterHeight);
// waterHeight.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

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.