ACE3/addons/vector/functions/fnc_getDistance.sqf

39 lines
671 B
Plaintext
Raw Normal View History

/*
* Author: commy2
*
*
* Arguments:
* None
*
* Return Value:
* Array <ARRAY>
*
* Example:
* call ace_vector_fnc_getDistance
*
* Public: No
*/
2015-01-14 06:24:17 +00:00
#include "script_component.hpp"
#define MIN_DISTANCE 10
2015-01-15 06:18:57 +00:00
#define MAX_DISTANCE [6000, 9000] select GVAR(useFeet)
disableSerialization;
private _dlgVector = GETUVAR(ACE_dlgVector,displayNull);
private _distance = ctrlText (_dlgVector displayCtrl 151);
2015-01-15 16:24:19 +00:00
if (_distance == "----") exitWith {-1000};
_distance = round parseNumber _distance;
2015-01-14 19:38:59 +00:00
if (GVAR(useFeet)) then {
2015-01-15 06:18:57 +00:00
_distance = 3.28084 * _distance;
};
2015-01-15 16:24:19 +00:00
if (_distance > MAX_DISTANCE) exitWith {-1000};
if (_distance < MIN_DISTANCE) exitWith {-1000};
_distance