Gameplay::getDistanceBetweenCoords: Difference between revisions
(yay) |
(yay) |
||
| Line 1: | Line 1: | ||
If useZ is false, only the 2D plane (X-Y) will be considered for calculating the distance.<br><br>Consider using this faster native instead: SYSTEM::VDIST - DVIST always takes in consideration the 3D coordinates. | If useZ is false, only the 2D plane (X-Y) will be considered for calculating the distance.<br><br>Consider using this faster native instead: SYSTEM::VDIST - DVIST always takes in consideration the 3D coordinates. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="javascript">gameplay.getDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, useZ);</syntaxhighlight> | <syntaxhighlight lang="javascript">mp.game.gameplay.getDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, useZ);</syntaxhighlight> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''x1:''' float | *'''x1:''' float | ||
| Line 14: | Line 14: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
todo | // todo | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{ | {{Gameplay_s_function_c}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:TODO: Example]] | [[Category:TODO: Example]] | ||
Revision as of 21:13, 6 May 2017
If useZ is false, only the 2D plane (X-Y) will be considered for calculating the distance.
Consider using this faster native instead: SYSTEM::VDIST - DVIST always takes in consideration the 3D coordinates.
Syntax
mp.game.gameplay.getDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, useZ);
Required Arguments
- x1: float
- y1: float
- z1: float
- x2: float
- y2: float
- z2: float
- useZ: Boolean
Return value
- float
Example
// todo