Rope::deleteRope: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ClientsideJsFunction}}
{{JSContainer|
Deletes a created rope.
=== Required Params ===
*'''handle:''' {{RageType|Handle}}
=== Return Value ===
*'''void''' {{RageType|void}}


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">rope.deleteRope(rope);</syntaxhighlight>
<pre>
=== Required Arguments ===
mp.game.physics.deleteRope(handle);
*'''rope:''' Object
</pre>
===Return value===
 
*'''Object'''
==Example==
==Example==
{{ClientsideCode|
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
const {x, y, z} = mp.players.local.position;
const forwardPos = mp.players.local.getForwardVector();
//create a new rope
const {result} = mp.game.physics.addRope(x, y, z, forwardPos.x, forwardPos.y, forwardPos.z, 50.0, 1, 50.0, 50.0, 1.2, false, true, true, 10.0, true, null);
mp.console.logInfo(`Rope created! Handle: ${result}`);
//delete created rope
mp.game.physics.deleteRope(result);
mp.console.logInfo(`Rope deleted!`);
 
</syntaxhighlight>
</syntaxhighlight>
}}
}}
==See also==
==See also==
{{Rope_function_c}}
{{Rope_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 10:47, 12 May 2024

Client-Side
Function

 JavaScript



JavaScript Syntax

Deletes a created rope.

Required Params

  • handle: Handle

Return Value

  • void void

Syntax

mp.game.physics.deleteRope(handle);

Example

Client-Side
const {x, y, z} = mp.players.local.position;
const forwardPos = mp.players.local.getForwardVector();
//create a new rope
const {result} = mp.game.physics.addRope(x, y, z, forwardPos.x, forwardPos.y, forwardPos.z, 50.0, 1, 50.0, 50.0, 1.2, false, true, true, 10.0, true, null);
mp.console.logInfo(`Rope created! Handle: ${result}`);
//delete created rope
mp.game.physics.deleteRope(result);
mp.console.logInfo(`Rope deleted!`);


See also