Jump to content
  • 0
Stanhope

Disabling switching into pilotseat on blackfish

Question

Some of you might be aware that if you get in the back of the blackfish and then switch to the pilot seat you don't get kicked out of it.  Well, i certainly was aware and here is a script to fix it:

 

Spoiler

aircraft_nocopilot = ["B_Heli_Light_01_F","B_Heli_Light_01_armed_F","O_Heli_Light_02_F","O_Heli_Light_02_unarmed_F","B_Heli_Transport_01_F","B_Heli_Transport_01_camo_F","I_Heli_Transport_02_F","I_Heli_light_03_unarmed_F","I_Heli_light_03_F"];

player addEventHandler ["getInMan",{
	_veh = _this select 2;
	_iampilot = typeOf player;
	
	if((_veh isKindOf "Helicopter" || _veh isKindOf "Plane") && !(_veh isKindOf "ParachuteBase")) then {
		if(({typeOf _veh == _x} count aircraft_nocopilot) > 0) then {
			_forbidden = [_veh turretUnit [0]];
			if(player in _forbidden) then {
				if !(player isKindOf "B_Helipilot_F") then {
					systemChat "Co-pilot is disabled on this vehicle";
					player action ["getOut",_veh];
				};
			};
		};
		if !(player isKindOf "B_Helipilot_F") then {
			_forbidden = [driver _veh];
			if (player in _forbidden) then {
				systemChat "You must be a pilot to fly this aircraft";
				player action ["getOut", _veh];
			};
		};
	};
}];

player addEventHandler ["SeatSwitchedMan",{
	_veh = _this select 2;
	_iampilot = typeOf player;
	if((_veh isKindOf "Helicopter" || _veh isKindOf "Plane") && !(_veh isKindOf "ParachuteBase")) then {
		if(({typeOf _veh == _x} count aircraft_nocopilot) > 0) then {
			_forbidden = [_veh turretUnit [0]];
			if(player in _forbidden) then {
				if !(player isKindOf "B_Helipilot_F") then {
					systemChat "Co-pilot is disabled on this vehicle";
					player action ["Eject",_veh];
				};
			};
		};
		if !(player isKindOf "B_Helipilot_F") then {
			_forbidden = [driver _veh];
			if (player in _forbidden) then {
				systemChat "You must be a pilot to fly this aircraft";
				player action ["Eject", _veh];
			};
		};
	};
}];

 

 

This specific script only kicks you from the blackfish if you switch into the pilot seat.  If it's wanted that the player also gets kicked out when he switches into the co-pilot seat the blackfish needs to be added to the aircraft_nocopilot array. ("B_T_VTOL_01_infantry_F", "B_T_VTOL_01_vehicle_F", "B_T_VTOL_01_armed_F")

Oh i should probably say that if you do it in mid flight you'll eject automatically.

 

And as always it's up to whoever it's up to to decide whether this gets used or not.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Forum Statistics

    8,903
    Total Topics
    57,754
    Total Posts
×