assignedVehicleRole

From Bohemia Interactive Community
Revision as of 17:20, 31 August 2022 by Killzone Kid (talk | contribs)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Returns the role a unit is assigned to within its assigned vehicle.
See AI Group Vehicle Management for more information.
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.
Groups:
Object Manipulation

Syntax

Syntax:
assignedVehicleRole unitName
Parameters:
unitName: Object
Return Value:
Array - the array which is returned contains:
  • [] - not assigned to any vehicle
  • ["driver"] - Assigned as driver
  • ["cargo"] (or ["cargo", [turret path]] since Arma 3 1.31.127272) - 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);

Additional Information

See also:
addVehicle assignedVehicle unassignVehicle leaveVehicle assignAsCargo assignAsCommander assignAsDriver assignAsGunner assignAsTurret crew assignedVehicles assignedGroup fullCrew

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Killzone_Kid - c
Posted on Aug 31, 2013 - 16:18 (UTC)
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.