{"name":"moveOut","title":"moveOut","type":"command","url":"https://community.bistudio.com/wiki/moveOut","revid":349641,"updated":"2023-11-16T22:02:40Z","groups":["Unit Control"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","locality":{"argument":"global","effect":"global"},"description":"Moves the soldier out of the vehicle.\n\nNotes:\n\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","params":[{"name":"soldier","type":"Object","description":"unit (only a living unit before Arma 3 v2.06)","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"soldier"}},{"syntax":"soldier moveOut vehicle","since":"arma3 2.06","params":[{"name":"soldier","type":"Object","description":"unit","type_expr":"Object"},{"name":"vehicle","type":"Object","description":"vehicle could be objNull, in this case the command is identical to the main syntax.","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"soldier"},"right":{"text":"vehicle"}}],"examples":[{"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];"]}],"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*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.*"}]}