---
name: "BIS_fnc_destroyer01OperateHangarDoors"
type: function
status: ok
groups: ["Destroyer"]
arma3_since: "1.84"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_destroyer01OperateHangarDoors
revid: 364795
updated: 2024-06-13T20:08:17Z
---

# BIS_fnc_destroyer01OperateHangarDoors

*Function · Destroyer · Arma 3 v1.84*

## Description

This function is designed to handle animations of ship hangar doors from vehicle user action (see [#Examples](../functions/BIS_fnc_destroyer01OperateHangarDoors.md#examples)).
It calls [BIS_fnc_destroyer01AnimateHangarDoors](../functions/BIS_fnc_destroyer01AnimateHangarDoors.md).

> [!IMPORTANT]
> Object (ship) must have all animations correctly defined and user actions configured.

## Syntax

```sqf
[shipPart, doorState] call BIS_fnc_destroyer01OperateHangarDoors
```

**Parameters:**

- `shipPart`: [Object](../topics/Object.md)
- `doorState`: [Number](../topics/Number.md) - doors' animation state; 1 to open, 0 to close

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
[this, 1] call BIS_fnc_destroyer01OperateHangarDoors; // to open doors
[this, 0] call BIS_fnc_destroyer01OperateHangarDoors; // to close doors
```

```cpp
class OpenHangarDoor_1
{
    displayNameDefault        = "<img image='\A3\Ui_f\data\IGUI\Cfg\Actions\open_door_ca.paa' size='2.5' />";
    displayName             = "$STR_DN_OUT_O_DOOR";
    position                 = "pos_Door_Hangar_1_Trigger";
    priority                 = 0.4;
    radius                     = 1.5;
    onlyForPlayer             = 0;
    condition                 = "(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') < 0.1;";
    statement                 = "[this, 1] call BIS_fnc_destroyer01OperateHangarDoors;";
};

class CloseHangarDoor_1 : OpenHangarDoor_1
{
    displayName             = "$STR_DN_OUT_C_DOOR";
    position                 = "pos_Door_Hangar_1_Trigger";
    condition                 = "(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') >= 0.1;";
    statement                 = "[this, 0] call BIS_fnc_destroyer01OperateHangarDoors;";
};
```

## See also

[BIS_fnc_destroyer01AnimateHangarDoors](../functions/BIS_fnc_destroyer01AnimateHangarDoors.md)

<sub>Source: [BI Community Wiki — BIS fnc destroyer01OperateHangarDoors](https://community.bistudio.com/wiki/BIS_fnc_destroyer01OperateHangarDoors) (revision 364795).</sub>
