; exit script 06 Field Excersise


; Saving player's status
aa = aP saveStatus "10Player";
; Player will be saved


GLB_10_HOWMANY = ("alive _x" count [tankc, tankd, tankg, tank2c, tank2d, tank2g]);
? GLB_10_HOWMANY + ("alive _x" count units group player) > 12 : GLB_10_HOWMANY = (12 - ("alive _x" count units group player));
saveVar "GLB_10_HOWMANY";

; Special soldiers
? alive aMed : GLB_10_MED = true; saveVar "GLB_10_MED"; xx = aMed saveStatus "10Medic";
? alive aMed2 : GLB_10_MED2 = true; saveVar "GLB_10_MED2"; xx = aMed2 saveStatus "10Medic2";

; ------- Player's group ---------

_i = count units group aP;
_j = 0;
_k = 0;
_Mis = "10";
_Out = [aMed, aMed2, aP];

#LOOP
? _j >= _i : goto "Next"

? ((units group aP) select _j) in _Out : goto "SKIP"
? alive ((units group aP) select _j) : xx = ((units group aP) select _j) saveStatus _Mis + (format ["Sold%1", _k]); _k = _k+1;

#SKIP
_j = _j + 1;
goto "LOOP"

#Next
GLB_10_NUMBER = _k; saveVar "GLB_10_NUMBER";


; ================== BEGIN: WEAPON POOL ====================

#POOL

; Added by mission designer


; Alway adding basic weapons


; ================== END: WEAPON POOL ====================


; -------- Vehicles ---------

aa = Tank saveStatus "10Tank";
aa = Tank2 saveStatus "10Tank2";
aa = BMP saveStatus "10BMP";
aa = Ural saveStatus "10Ural";

GLB_10_TankX = ((getpos Tank) select 0); saveVar "GLB_10_TankX";
GLB_10_TankY = ((getpos Tank) select 1); saveVar "GLB_10_TankY";
GLB_10_TankD = getdir Tank; saveVar "GLB_10_TankD";

GLB_10_Tank2X = ((getpos Tank2) select 0); saveVar "GLB_10_Tank2X";
GLB_10_Tank2Y = ((getpos Tank2) select 1); saveVar "GLB_10_Tank2Y";
GLB_10_Tank2D = getdir Tank2; saveVar "GLB_10_Tank2D";

GLB_10_BMPX = ((getpos BMP) select 0); saveVar "GLB_10_BMPX";
GLB_10_BMPY = ((getpos BMP) select 1); saveVar "GLB_10_BMPY";
GLB_10_BMPD = getdir BMP; saveVar "GLB_10_BMPD";

GLB_10_UralX = ((getpos Ural) select 0); saveVar "GLB_10_UralX";
GLB_10_UralY = ((getpos Ural) select 1); saveVar "GLB_10_UralY";
GLB_10_UralD = getdir Ural; saveVar "GLB_10_UralD";






; ------------- END -------------
