2015-01-11 16:42:31 +00:00
|
|
|
// by commy2
|
2015-01-14 06:24:17 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
#define MIN_DISTANCE 10
|
2015-01-15 06:18:57 +00:00
|
|
|
#define MAX_DISTANCE [6000, 9000] select GVAR(useFeet)
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-14 19:38:59 +00:00
|
|
|
private ["_dlgVector", "_distance"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
disableSerialization;
|
2015-01-15 06:18:57 +00:00
|
|
|
_dlgVector = GETUVAR(ACE_dlgVector,displayNull);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-14 19:38:59 +00:00
|
|
|
_distance = ctrlText (_dlgVector displayCtrl 151);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-15 16:24:19 +00:00
|
|
|
if (_distance == "----") exitWith {-1000};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_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-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-01-15 16:24:19 +00:00
|
|
|
if (_distance > MAX_DISTANCE) exitWith {-1000};
|
|
|
|
if (_distance < MIN_DISTANCE) exitWith {-1000};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_distance
|