assignedVehicleRole: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 ") |
||
Line 38: | Line 38: | ||
|x2= Get weapons available to player at player occupied turret:<code>_weaponsTurret = [[vehicle]] [[player]] [[weaponsTurret]] ([[assignedVehicleRole]] [[player]] [[select]] 1);</code> | |x2= Get weapons available to player at player occupied turret:<code>_weaponsTurret = [[vehicle]] [[player]] [[weaponsTurret]] ([[assignedVehicleRole]] [[player]] [[select]] 1);</code> | ||
|seealso= [[addVehicle]] [[assignedVehicle]] [[unassignVehicle]] [[leaveVehicle]] [[assignAsCargo]] [[assignAsCommander]] [[assignAsDriver]] | |seealso= [[addVehicle]] [[assignedVehicle]] [[unassignVehicle]] [[leaveVehicle]] [[assignAsCargo]] [[assignAsCommander]] [[assignAsDriver]] [[assignAsGunner]], [[assignAsTurret]], [[crew]], [[fullCrew]] | ||
}} | }} | ||
Revision as of 14:56, 20 January 2022
Description
- Description:
- Returns the role a unit is assigned to within its assigned vehicle.
- 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", [turret path]] - Assigned to a turret
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 assignAsGunnerassignAsTurretcrewfullCrew
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
- Posted on August 31, 2013
- Killzone_Kid
- 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.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.05
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Object Manipulation