RedM Natives

ADD_ROPE

There are 19 types of rope, from type = 0 to type = 18 Rope definitions are stored in ropedata.xml Rope types 0, 15 and 18 have proper physics for hanging objects (taut, do not sag, small to medium diameter, good aspect for a rope)

Hash0xE832D760399EB220
Runtime nameAddRope
NamespacePHYSICS
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xE832D760399EB220

Signature

int ADD_ROPE(float x, float y, float z, float rotX, float rotY, float rotZ, float length, int ropeType, float maxLength, float minLength, float p10, BOOL p11, BOOL p12, BOOL rigid, float p14, BOOL breakWhenShot, Any* unkPtr, BOOL p17);

Parameters

NameTypeDescription
xfloat—
yfloat—
zfloat—
rotXfloat—
rotYfloat—
rotZfloat—
lengthfloat—
ropeTypeint—
maxLengthfloat—
minLengthfloat—
p10float—
p11BOOL—
p12BOOL—
rigidBOOL—
p14float—
breakWhenShotBOOL—
unkPtrAny*—
p17BOOL—

Returns int

Description

There are 19 types of rope, from type = 0 to type = 18
Rope definitions are stored in ropedata.xml
Rope types 0, 15 and 18 have proper physics for hanging objects (taut, do not sag, small to medium diameter, good aspect for a rope)

Usage

Lua
local retval, unkPtr = AddRope(x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, p10, p11, p12, rigid, p14, breakWhenShot, p17)

-- always works, by hash
local retval, unkPtr = Citizen.InvokeNative(0xE832D760399EB220, x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, p10, p11, p12, rigid, p14, breakWhenShot, Citizen.PointerValueInt(), p17, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, unkPtr] = AddRope(x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, p10, p11, p12, rigid, p14, breakWhenShot, p17);

// by hash
const [retval, unkPtr] = Citizen.invokeNative('0xE832D760399EB220', x + 0.0000001, y + 0.0000001, z + 0.0000001, rotX + 0.0000001, rotY + 0.0000001, rotZ + 0.0000001, length + 0.0000001, ropeType, maxLength + 0.0000001, minLength + 0.0000001, p10 + 0.0000001, p11, p12, rigid, p14 + 0.0000001, breakWhenShot, Citizen.pointerValueInt(), p17, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var unkPtr = new OutputArgument();
int retval = Function.Call<int>((Hash)0xE832D760399EB220, x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, p10, p11, p12, rigid, p14, breakWhenShot, unkPtr, p17);
// unkPtr.GetResult<int>()
  • 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.
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB

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