ACE3/addons/bft_devices/functions/fnc_distance2D.sqf
2018-10-04 16:43:06 +02:00

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