{"name":"BIS_fnc_endMission","operator":null,"title":"BIS fnc endMission","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_endMission","revid":341330,"updated":"2023-05-22T00:44:50Z","groups":["Missions"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Ends mission with a signature shot or a fade effect, marks it finished for Steam and activates a key in format `activateKey format [\"BIS_%1.%2_done\", missionName, worldName];`.\n\n> [!IMPORTANT]\n> This function should always be used instead of the simple endMission/failMission commands or trigger endings; otherwise, singleplayer scenarios will not properly be marked as played/finished in the game and on Steam!","syntaxes":[{"syntax":"[endName, isVictory, fadeType, playMusic, cancelTasks] call BIS_fnc_endMission","since":null,"effect":null,"exec":null,"params":[{"name":"endName (Optional, default \"end1\")","type":null,"optional":false,"default":null,"description":"- String - end type from `configFile >> \"CfgDebriefing\"`. Same as with endMission and failMission\n- Array - in format [endName, ID], will be composed to \"endName_ID\" string","types":[],"since":null,"text":"endName (Optional, default \"end1\"):\n- String - end type from `configFile >> \"CfgDebriefing\"`. Same as with endMission and failMission\n- Array - in format [endName, ID], will be composed to \"endName_ID\" string"},{"name":"isVictory","type":"Boolean","optional":true,"default":"true","description":"true for successful end, false for failed end","types":["Boolean"],"since":null,"text":"isVictory: Boolean - (Optional, default true) true for successful end, false for failed end"},{"name":"fadeType","type":"Boolean or Number","optional":true,"default":"true","description":"true for signature closing shot. When number, simple fade to black of given duration is used","types":["Boolean","Number"],"since":null,"text":"fadeType: Boolean or Number - (Optional, default true) true for signature closing shot. When number, simple fade to black of given duration is used"},{"name":"playMusic","type":"Boolean","optional":true,"default":"true","description":"false to disable automatic music during closing shot","types":["Boolean"],"since":null,"text":"playMusic: Boolean - (Optional, default true) false to disable automatic music during closing shot"},{"name":"cancelTasks","type":"Boolean","optional":true,"default":"false","description":"true to cancel all pending tasks","types":["Boolean"],"since":null,"text":"cancelTasks: Boolean - (Optional, default false) true to cancel all pending tasks"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"}}],"examples":[{"text":"```sqf\n\"end1\" call BIS_fnc_endMission;\n```","code":["\"end1\" call BIS_fnc_endMission;"]},{"text":"```sqf\n[\"epicFail\", false, 2] call BIS_fnc_endMission;\n```","code":["[\"epicFail\", false, 2] call BIS_fnc_endMission;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_endMissionServer","Debriefing","endMission","markAsFinishedOnSteam"],"notes":[{"user":"R3vo","date":"2016-03-21T11:12:00Z","text":"To end a multiplayer mission one can use `[\"end1\", true] remoteExecCall [\"BIS_fnc_endMission\"];` - see also BIS_fnc_endMissionServer."}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Missions","Functions","Functions: Local Effect","Introduced with Arma 3 version 0.50","Introduced with Take On Helicopters version 1.00","Take On Helicopters: Functions","Take On Helicopters: New Functions"],"docblock":null,"filled_from_docblock":[]}