mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
29 lines
463 B
Plaintext
29 lines
463 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Gundy
|
|
*
|
|
* Description:
|
|
* Calculate the 2D distance between two positions
|
|
*
|
|
* Arguments:
|
|
* 0: 2D or 3D position <ARRAY>
|
|
* 1: 2D or 3D position <ARRAY>
|
|
*
|
|
* Return Value:
|
|
* Distance <FLOAT>
|
|
*
|
|
* Example:
|
|
* [getPosATL player, [0,0,0]] call ace_bft_devices_fnc_distance2D;
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
|
|
params ["_pos1", "_pos2"];
|
|
|
|
// set height to 0;
|
|
_pos1 set [2,0];
|
|
_pos2 set [2,0];
|
|
|
|
_pos1 distance _pos2
|