The above will still allow the gunner to see and fire on targets he just won't do it as often and the pilot won't turn to engage the enemy.
I did this script a while back but never finished it.
if you place this in a waypoint or trigger nul=[heli] execvm "hold.sqf" it will slow a chopper and have him hold position. He is however free to turn and engage the enemy when he sees it. If you give him heli domove getpos targetpos commands you have control of his direction, he will turn to that direction. Maybe not in battle, I haven't checked.
To cancel the action just use halt_heli=false placed in a trigger and he will return to normal flying.
There is more you could add such as adjust his height so he could pop up and down.
save as "hold.sqf"
PHP Code:
//nul=[heli] execvm "hold.sqf";
halt_heli = true ;// heli will stop when script is run
_plane = _this select 0;
_pitchbank = _plane call BIS_fnc_getPitchBank;
_pitch = _pitchbank select 0;
_bank = _pitchbank select 1;
//hint format ["Pitch %1 Bank %2",_pitch,_bank];
_nspeed_x = 0;
_nspeed_y = 0;
while {alive _plane and halt_heli} do
{
if (_pitch > -5 ) then {_pitch = _pitch - 0.1} else {_pitch = _pitch + 0.1};// slight nose down for better response
if (_bank > 0 ) then {_bank = _bank - 0.1} else {_bank = _bank + 0.1};
_speed_Veh = velocity _plane;
_speed_x = _speed_Veh select 0;
_speed_y = _speed_Veh select 1;
_speed_z = _speed_Veh select 2;
if (_speed_x > 0) then {_nspeed_x = _speed_x / 1.01;};
if (_speed_y > 0) then {_nspeed_y = _speed_y / 1.01;};
if (_speed_z > 0) then {_nspeed_z = _speed_z / 1.0001;};
//
[_plane, _Pitch,_Bank] call BIS_fnc_setPitchBank;
_plane setVelocity [_nspeed_x,_nspeed_y,_speed_z];
sleep 0.001;
};
I don't think forcespeed works on chopper or planes.