Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHYSICS - DeleteRope]: Added Native Documentation #1148

Merged
38 changes: 36 additions & 2 deletions PHYSICS/DeleteRope.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,44 @@ ns: PHYSICS

```c
// 0x52B4829281364649 0x748D72AF
void DELETE_ROPE(int* ropeId);
void DELETE_ROPE(int* ropeHandle);
```

Deletes the rope with the specified handle.
You might want to check if the rope exists before with [DOES_ROPE_EXIST](#_0xFD5448BE3111ED96).

## Parameters
* **ropeId**:
* **ropeHandle**: The handle of the rope to delete

## Examples
```lua
-- Create a rope and store the handle
local rope = AddRope(-2096.096436, -311.906891, 14.510918, 0.0, 0.0, 0.0, 10.0, 1, 10.0, 0.0, 1.0, false, false, false, 1.0, false, 0)

-- Check if the rope exists.
if not DoesRopeExist(rope) then
-- If the rope does not exist, end the execution of the code here.
return
end

-- If the rope does exist, delete the rope.
DeleteRope(rope)
JayPaulinCodes marked this conversation as resolved.
Show resolved Hide resolved
```

```cs
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
using static CitizenFX.Core.Native.API;

// Create a rope and store the reference
int unkPtr = 0;
int ropehandle = AddRope(0f, 0f, 0f, 0f, 0f, 0f, 10f, 5, 10f, 0f, 1f, false, false, false, 1f, false, ref unkPtr);

// Check if the rope exists.
if (!DoesRopeExist(ref ropehandle))
{
// If the rope does not exist, end the execution of the code here.
return;
}

// If the rope does exist, delete the rope.
DeleteRope(ref ropehandle);
AvarianKnight marked this conversation as resolved.
Show resolved Hide resolved
```
Loading