G'day, here's the script so far..
private
["_firer","_range","_type","_distance","_targets","_numtgts","_v","_n0","_n1","_tgttype","_tgtcnt","_enunits","_ttype","_tid","_fpos","typcnt"];
_firer = _this select 0;
_range = _this select 1;
_type = [];
_distance = [];
_enunits = [];
_ttype = [];
_tid = [];
_fpos = [];
_targets = _firer NearTargets _range;
_numtgts = count _targets;
_v = 0;
_n0 = 0;
_n1 = 1;
_tgttype = ["DSHKM","AGS","D30","BRDM2","UAZMG","UAZ_AGS30","BRDM2_ATGM","BMP2","ZSU","KA50","MI17_MG","SU34B","RHIB","RHIB2Turret"];
_tgtcnt = count _targets;
/*
; SCREEN FOR THREAT
*/
while { _v < _tgtcnt } do
{
_enunits = _targets select _v;
_ttype = _enunits select 1;
_tid = _enunits select 4;
if (_ttype in _tgttype) then
{
_type = _type + [_tid];
};
_v = _v + 1;
};
/*
; GET RANGES TO NEWLY ARRAYED UNITS
*/
_typcnt = count _type;
while { _v < _typcnt} do
{
_fpos = getpos _firer;
_ttype = _type select _v;
hint format ["type count = %1",_typcnt];
sleep 5;
_distance = _fpos distance getpos _ttype;
hint format ["distance = %1",_distance];
sleep 5;
_enunits = _enunits + [_distance];
hint format ["variable = %1",_enunits];
sleep 5;
_v = _v + 1;
};
and here's the error...
Error in expression <\Ahren\missions\test.Intro\target.sqf"
private ["_firer","_range","_type","_dis>
Error position: <private ["_firer","_range","_type","_dis>
Error Local variable in global space
File C:\Users\User\.........................\missions\test.Intro\target.sqf, line 2
I dont know what that really means, and I've done a search for local variables in a global space....nothing. I've declared them as private so I dont know what I'm doing wrong here..