Rope::addRope: Difference between revisions
(→Syntax) |
|||
| Line 1: | Line 1: | ||
Creates a rope at the specific position, that extends in the specified direction when not attached to any entities.<br>__<br><br>Add_Rope(pos.x,pos.y,pos.z,0.0,0.0,0.0,20.0,4,20.0,1.0,0.0,false,false,false,5.0,false,NULL)<br><br>When attached, Position<vector> does not matter<br>When attached, Angle<vector> does not matter<br><br>Rope Type:<br>4 and bellow is a thick rope<br>5 and up are small metal wires<br>0 crashes the game<br><br>Max_length - Rope is forced to this length, generally best to keep this the same as your rope length.<br><br>Rigid - If max length is zero, and this is set to false the rope will become rigid (it will force a specific distance, what ever length is, between the objects).<br><br>breakable - Whether or not shooting the rope will break it.<br><br>unkPtr - unknown ptr, always 0 in orig scripts<br>__<br><br>Lengths can be calculated like so:<br><br>float distance = abs(x1 - x2) + abs(y1 - y2) + abs(z1 - z2); // Rope length<br><br><br>NOTES:<br><br>Rope does NOT interact with anything you attach it to, in some cases it make interact with the world AFTER it breaks (seems to occur if you set the type to -1).<br><br>Rope will sometimes contract and fall to the ground like you'd expect it to, but since it doesn't interact with the world the effect is just jaring. | Creates a rope at the specific position, that extends in the specified direction when not attached to any entities.<br>__<br><br>Add_Rope(pos.x,pos.y,pos.z,0.0,0.0,0.0,20.0,4,20.0,1.0,0.0,false,false,false,5.0,false,NULL)<br><br>When attached, Position<vector> does not matter<br>When attached, Angle<vector> does not matter<br><br>Rope Type:<br>4 and bellow is a thick rope<br>5 and up are small metal wires<br>0 crashes the game<br><br>Max_length - Rope is forced to this length, generally best to keep this the same as your rope length.<br><br>Rigid - If max length is zero, and this is set to false the rope will become rigid (it will force a specific distance, what ever length is, between the objects).<br><br>breakable - Whether or not shooting the rope will break it.<br><br>unkPtr - unknown ptr, always 0 in orig scripts<br>__<br><br>Lengths can be calculated like so:<br><br>float distance = abs(x1 - x2) + abs(y1 - y2) + abs(z1 - z2); // Rope length<br><br><br>NOTES:<br><br>Rope does NOT interact with anything you attach it to, in some cases it make interact with the world AFTER it breaks (seems to occur if you set the type to -1).<br><br>Rope will sometimes contract and fall to the ground like you'd expect it to, but since it doesn't interact with the world the effect is just jaring. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="javascript">mp.game.rope.addRope(x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, | <syntaxhighlight lang="javascript">mp.game.rope.addRope(x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, p10, p11, p12, rigid, p14, breakWhenShot, unkPtr);</syntaxhighlight> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''x:''' float | *'''x:''' float | ||
Revision as of 03:53, 31 October 2020
Creates a rope at the specific position, that extends in the specified direction when not attached to any entities.
__
Add_Rope(pos.x,pos.y,pos.z,0.0,0.0,0.0,20.0,4,20.0,1.0,0.0,false,false,false,5.0,false,NULL)
When attached, Position<vector> does not matter
When attached, Angle<vector> does not matter
Rope Type:
4 and bellow is a thick rope
5 and up are small metal wires
0 crashes the game
Max_length - Rope is forced to this length, generally best to keep this the same as your rope length.
Rigid - If max length is zero, and this is set to false the rope will become rigid (it will force a specific distance, what ever length is, between the objects).
breakable - Whether or not shooting the rope will break it.
unkPtr - unknown ptr, always 0 in orig scripts
__
Lengths can be calculated like so:
float distance = abs(x1 - x2) + abs(y1 - y2) + abs(z1 - z2); // Rope length
NOTES:
Rope does NOT interact with anything you attach it to, in some cases it make interact with the world AFTER it breaks (seems to occur if you set the type to -1).
Rope will sometimes contract and fall to the ground like you'd expect it to, but since it doesn't interact with the world the effect is just jaring.
Syntax
mp.game.rope.addRope(x, y, z, rotX, rotY, rotZ, length, ropeType, maxLength, minLength, p10, p11, p12, rigid, p14, breakWhenShot, unkPtr);
Required Arguments
- x: float
- y: float
- z: float
- rotX: float
- rotY: float
- rotZ: float
- length: float
- ropeType: int
- maxLength: float
- minLength: float
- p10: float
- p11: Boolean
- p12: Boolean
- rigid: Boolean
- p14: float
- breakWhenShot: Boolean
- unkPtr: unknown (to be checked)
Return value
- Object handle or object
Example
// todo