When player is in a group of AIs and is not the leader, assignedVehicleRole of the player could be unpredictable and absolutely not related to the position player occupies. In short, forget about this command for the player, it is unreliable and has been broken too many times in the past.
Description
Returns the role a unit is assigned to within its assigned vehicle.
Note
See AI Group Vehicle Management for more information.
Syntax
assignedVehicleRole unitName
Parameters:
unitName: Object
Returns: Array - the array which is returned contains:
- [] - not assigned to any vehicle
- ["driver"] - Assigned as driver
- ["cargo"] or Arma 3 v1.32 ["cargo", [turret path]] - assigned as cargo
- ["turret", turretPath] - assigned to a turret (turretPath format Turret Path)
Examples
Example 1
_RoleArray = assignedVehicleRole player;
Example 2
Get weapons available to player at player occupied turret:
_weaponsTurret = vehicle player weaponsTurret (assignedVehicleRole player select 1);
Multiplayer
On a client the command will return empty arrays for every unit that is not local. On the server the command correctly returns the role, regardless of the units locality.
See also
addVehicle · assignedVehicle · unassignVehicle · leaveVehicle · assignAsCargo · assignAsCommander · assignAsDriver · assignAsGunner · assignAsTurret · crew · assignedVehicles · assignedGroup · fullCrew