emptyPositions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(tested this assertion by running emptyPositions and fullCrew(with both true & false) 1,000,000 times and comparing the runtime of each)
m (Add positions back)
Line 27: Line 27:
|p1= vehicle: [[Object]]
|p1= vehicle: [[Object]]


|p2= position: [[String]]
|p2= position: [[String]] - can be one of:
* {{hl|"Commander"}}
* {{hl|"Driver"}}
* {{hl|"Gunner"}}
* {{hl|"Cargo"}}


|r1= [[Number]]
|r1= [[Number]]


|x1= <code>_freeCargoPositions = [[vehicle]] [[player]] [[emptyPositions]] "cargo";</code>
|x1= <sqf>_freeCargoPositions = vehicle player emptyPositions "cargo";</sqf>


|seealso= [[moveInDriver]] [[moveInTurret]] [[moveInCommander]] [[moveInGunner]] [[moveInCargo]] [[getCargoIndex]]
|seealso= [[moveInDriver]] [[moveInTurret]] [[moveInCommander]] [[moveInGunner]] [[moveInCargo]] [[getCargoIndex]]
}}
}}

Revision as of 00:53, 20 March 2022

Hover & click on the images for description

Description

Description:
Returns the number of given positions in the vehicle.
To return the actual units in the vehicle use fullCrew. However if only the number is desired, use emptyPositions because it is faster.
Groups:
Object ManipulationUnit Control

Syntax

Syntax:
vehicle emptyPositions position
Parameters:
vehicle: Object
position: String - can be one of:
  • "Commander"
  • "Driver"
  • "Gunner"
  • "Cargo"
Return Value:
Number

Examples

Example 1:
_freeCargoPositions = vehicle player emptyPositions "cargo";

Additional Information

See also:
moveInDriver moveInTurret moveInCommander moveInGunner moveInCargo getCargoIndex

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