Code:
private ["_bpos","_vel","_dir","_speed","_dir_i","_func","_vehArr","_unit","_range","_pilot","_lgb","_target","_class","_list","_apos"];
_vehArr = [getPosATL airSpawnPos, 300, "A10_US_EP1", WEST] call bis_fnc_spawnvehicle;
_unit = _vehArr select 0;
_name = name (vehicle _unit);
_range = 1250;
_pilot = (_vehArr select 1) select 0;
_unitGrp = _vehArr select 1;
//nul = [_unit,_pilot] execVM "countermeasures.sqf";
_unit removeMagazinesTurret ["4Rnd_GBU12",[-1]];
_unit removeMagazinesTurret ["14Rnd_FFAR",[-1]];
_unit removeMagazinesTurret ["1350Rnd_30mmAP_A10",[-1]];
_unit removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[-1]];
_unit removeMagazinesTurret ["2Rnd_Maverick_A10",[-1]];
_unit setPosATL [ getPosATL _unit select 0, getPosATL _unit select 1, (getPosATL _unit select 2) +350];
_dirJet = direction _unit;
_unit setVelocity [sin (_dirJet) * 100, cos (_dirJet) * 100, 0];
_unit flyinheight 500;
_unit allowDamage false;
_wp1 = (group _unit) addWaypoint [position player, 1];
_wp1 setWaypointType "MOVE";
hint "Incomming Aircraft!(LGB)";
//selectPlayer _pilot;
waitUntil {(player distance _unit) <= _range};
_pilot sidechat format ["Pilot %1:Weapons Hot! Ripple GBU12 x2",_name];
{_bpos = [getPosATL _unit select 0, getPosATL _unit select 1, (getPosATL _unit select 2)-10];
_lgb = "Bo_GBU12_LGB" createVehicle _bpos;
_dir_i = [_unit, player] call BIS_fnc_dirTo;
_lgb setDir _dir_i;
_func = [_lgb, -30, 0] call BIS_fnc_setPitchBank;
_vel = velocity _unit;
_dir = direction _lgb;
_speed = 90;
_lgb setVelocity [(_vel select 0)+((sin _dir)*_speed),(_vel select 1)+ ((cos _dir)*_speed),(_vel select 2)-_speed];
sleep 2;} forEach [1,2,3,4];
_wp2 = (group _unit) addWaypoint [getPosATL airSpawnPos, 2];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointStatements ["true", "{deletevehicle _unit} foreach crew (vehicle this);deleteVehicle (vehicle this)"];