{"name":"moveOut","operator":null,"title":"moveOut","type":"command","url":"https://community.bistudio.com/wiki/moveOut","revid":349641,"updated":"2023-11-16T22:02:40Z","groups":["Unit Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Moves the soldier out of the vehicle.\n\nNotes:\n- Works for both AI and player entities\n- AI unit gets back in - unless is under player command or combined with other sqf commands (orderGetIn false, allowGetIn false or leaveVehicle)\n- Respects the vehicle's lock state (same as action \"Eject\") - unlike doGetOut, commandGetOut. It will work for player entities regardless though\n- Still executes when the vehicle is moving/flying (same as action \"Eject\") - unlike doGetOut, commandGetOut\n- Without vehicle's position's get out animation - unlike action eject, doGetOut, commandGetOut\n- Immediately - unlike action eject, doGetOut, commandGetOut\n- Works also on dead units (same as action \"Eject\" (but one after another)) - unlike doGetOut, commandGetOut\n- Does not work for UAV crew\n- Does not work for remoteControlled units\n- Works on unconscious (same as action \"Eject\" (but one after another)) - unlike doGetOut, commandGetOut (unless AI under player command)","syntaxes":[{"syntax":"moveOut soldier","since":null,"effect":null,"exec":null,"params":[{"name":"soldier","type":"Object","optional":false,"default":null,"description":"unit (only a living unit before Arma 3 v2.06)","types":["Object"],"since":null,"text":"soldier: Object - unit (only a living unit before Arma 3 v2.06)"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"soldier","types":["Object"]}},{"syntax":"soldier moveOut vehicle","since":"arma3 2.06","effect":null,"exec":null,"params":[{"name":"soldier","type":"Object","optional":false,"default":null,"description":"unit","types":["Object"],"since":null,"text":"soldier: Object - unit"},{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle could be objNull, in this case the command is identical to the main syntax.","types":["Object"],"since":null,"text":"vehicle: Object - vehicle could be objNull, in this case the command is identical to the main syntax."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"soldier","types":["Object"]},"right":{"text":"vehicle","types":["Object"]}}],"examples":[{"text":"```sqf\n{ if (lifeState _x == \"UNCONSCIOUS\") then { moveOut _x } } forEach crew cursorTarget;\n```","code":["{ if (lifeState _x == \"UNCONSCIOUS\") then { moveOut _x } } forEach crew cursorTarget;"]},{"text":"Move out player just before he dies:\n\n```sqf\nplayer addEventHandler [\n    \"HandleDamage\", \n    format [\n        'if (switch (_this select 1) do {\n            case \"\": { _this select 2 >= 1 };\n            case \"head\": {_this select 2 >= %1};\n            case \"body\": {_this select 2 >= %2};\n            default {false};\n        }) then {moveOut player}',\n        getNumber (configFile >> \"CfgFirstAid\" >> \"CriticalHeadHit\"),\n        getNumber (configFile >> \"CfgFirstAid\" >> \"CriticalBodyHit\")\n    ]\n];\n```","code":["player addEventHandler [\n\t\"HandleDamage\", \n\tformat [\n\t\t'if (switch (_this select 1) do {\n\t\t\tcase \"\": { _this select 2 >= 1 };\n\t\t\tcase \"head\": {_this select 2 >= %1};\n\t\t\tcase \"body\": {_this select 2 >= %2};\n\t\t\tdefault {false};\n\t\t}) then {moveOut player}',\n\t\tgetNumber (configFile >> \"CfgFirstAid\" >> \"CriticalHeadHit\"),\n\t\tgetNumber (configFile >> \"CfgFirstAid\" >> \"CriticalBodyHit\")\n\t]\n];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3: Actions","doGetOut","commandGetOut","leaveVehicle","moveInDriver","moveInGunner","moveInCommander","moveInTurret","moveInCargo","isTurnedOut"],"notes":[{"user":".kju","date":"2020-08-07T08:53:00Z","text":"This seems no longer true in Arma 3:\n\n*Does not work on dead crew - Use setPos family of commands to move dead units out soon after they became dead. After awhile dead unit's group becomes grpNull and it cannot be moved out at all.*"}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Control","Introduced with Arma 2 version 1.00","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}