Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.00

Description

Description:Returns the role a unit is assigned to, within its assigned vehicle.

The returned array contains:

  • [] - Not assigned to any vehicle.
  • ["Driver"] - Assigned as driver.
  • ["Cargo"] - Assigned as cargo.
  • ["Turret", [turret path]] - Assigned to a turret.

If no vehicle role is assigned, an empty array is returned.

Syntax

Syntax:assignedVehicleRole unit
Parameters:
Return Value:Array

Examples

Examples:
_RoleArray=assignedVehicleRole player

Additional Information

See also: assignedVehicle, unassignVehicle
Multiplayer:
Problems:

Notes







Posted on Jan 22, 2011
Kronzky
Since this command does not return any "commander" roles you have to use some code like the one below to find out if he is the commander:


_role = assignedVehicleRole someUnit;
{
  if (_x == commander vehicle _x) exitWith {
    _role = ["Commander"];
  }
}forEach (crew vehicle someUnit);