Arma 3 Scripting

deleteVehicleCrew

  • Global argument
  • Global effect
  • Arma 3 v1.32

Command · Markdown · JSON · original wiki page

Description

Deletes a member of or the whole crew of a vehicle. Human players cannot be deleted.

Note

This command attempts to move the given crew member out before deleting it. Made especially for deleting dead crew members, as using conventional deleteVehicle leads to all sorts of bugs and ghost objects. While the argument is global, you should take extra steps and execute this where vehicle is local as moving units out of the vehicle happens where vehicle is local and you want this to always precede deletion.

Syntax

Syntax 1

vehicle deleteVehicleCrew unit

Parameters:

Returns: Nothing

Syntax 2

since arma3 2.06

deleteVehicleCrew vehicle

Parameters:

Returns: Nothing

Examples

Example 1

// delete when knowing the vehicle
_helicopter deleteVehicleCrew driver _helicopter;

// delete when only knowing the unit
// vehicle _soldier deleteVehicleCrew _soldier;        // may return the unit itself when used on dead crew
objectParent _soldier deleteVehicleCrew _soldier;    // faster and always returns the vehicle

Example 2

Delete entire crew:

deleteVehicleCrew _tank; // since v2.06

{ _helicopter deleteVehicleCrew _x } forEach crew _helicopter; // before v2.06

See also

createVehicleCrew · moveInDriver · moveInGunner · moveInCommander · moveInTurret · moveInCargo · Arma 3: Event Handlers

Community notes

Killzone_Kid

If you delete the AI pilot with deleteVehicle driver heli the co-pilot will jump out.

If you delete the AI pilot with heli deleteVehicleCrew driver heli the co-pilot will stay.