{"name":"BIS_fnc_destroyer01OperateHangarDoors","title":"BIS fnc destroyer01OperateHangarDoors","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_destroyer01OperateHangarDoors","revid":364795,"updated":"2024-06-13T20:08:17Z","groups":["Destroyer"],"status":"ok","games":{"arma3":"1.84"},"since":"arma3 1.84","arma3_since":"1.84","description":"This function is designed to handle animations of ship hangar doors from vehicle user action (see Examples).\nIt calls BIS_fnc_destroyer01AnimateHangarDoors.\n\n> [!IMPORTANT]\n> Object (ship) must have all animations correctly defined and user actions configured.","syntaxes":[{"syntax":"[shipPart, doorState] call BIS_fnc_destroyer01OperateHangarDoors","params":[{"name":"shipPart","type":"Object","type_expr":"Object"},{"name":"doorState","type":"Number","description":"doors' animation state; 1 to open, 0 to close","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"text":"```sqf\n[this, 1] call BIS_fnc_destroyer01OperateHangarDoors; // to open doors\n[this, 0] call BIS_fnc_destroyer01OperateHangarDoors; // to close doors\n```\n\n```cpp\nclass OpenHangarDoor_1\n{\n    displayNameDefault        = \"<img image='\\A3\\Ui_f\\data\\IGUI\\Cfg\\Actions\\open_door_ca.paa' size='2.5' />\";\n    displayName             = \"$STR_DN_OUT_O_DOOR\";\n    position                 = \"pos_Door_Hangar_1_Trigger\";\n    priority                 = 0.4;\n    radius                     = 1.5;\n    onlyForPlayer             = 0;\n    condition                 = \"(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') < 0.1;\";\n    statement                 = \"[this, 1] call BIS_fnc_destroyer01OperateHangarDoors;\";\n};\n\nclass CloseHangarDoor_1 : OpenHangarDoor_1\n{\n    displayName             = \"$STR_DN_OUT_C_DOOR\";\n    position                 = \"pos_Door_Hangar_1_Trigger\";\n    condition                 = \"(((nearestObjects [this, ['Land_Destroyer_01_hull_04_F'], 50, false]) select 0) animationPhase 'Door_Hangar_1_1_open') >= 0.1;\";\n    statement                 = \"[this, 0] call BIS_fnc_destroyer01OperateHangarDoors;\";\n};\n```","code":["[this, 1] call BIS_fnc_destroyer01OperateHangarDoors; // to open doors\n[this, 0] call BIS_fnc_destroyer01OperateHangarDoors; // to close doors"]}],"see_also":["BIS_fnc_destroyer01AnimateHangarDoors"]}