ACE3/addons/vector/functions/fnc_getDistance.sqf

26 lines
548 B
Plaintext
Raw Normal View History

// by commy2
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)
2015-01-14 19:38:59 +00:00
private ["_dlgVector", "_distance"];
disableSerialization;
2015-01-15 06:18:57 +00:00
_dlgVector = GETUVAR(ACE_dlgVector,displayNull);
2015-01-14 19:38:59 +00:00
_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