RedM Natives

TEST_PROBE_AGAINST_ALL_WATER

SCRIPT_WATER_TEST_RESULT_NONE, SCRIPT_WATER_TEST_RESULT_WATER, SCRIPT_WATER_TEST_RESULT_BLOCKED,

Hash0x8974647ED222EA5F
Runtime nameTestProbeAgainstAllWater
NamespaceWATER
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x8974647ED222EA5F

Signature

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

Parameters

NameTypeDescription
x1float—
y1float—
z1float—
x2float—
y2float—
z2float—
flagsint—
intersectionPosVector3*—

Returns int

Description

enum eScriptWaterTestResult
{
	SCRIPT_WATER_TEST_RESULT_NONE,
	SCRIPT_WATER_TEST_RESULT_WATER,
	SCRIPT_WATER_TEST_RESULT_BLOCKED,
};

Usage

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

-- always works, by hash
local retval, intersectionPos = Citizen.InvokeNative(0x8974647ED222EA5F, x1, y1, z1, x2, y2, z2, flags, Citizen.PointerValueVector(), Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
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#
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

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