magazinesAllTurrets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(some info on magazine ids)
mNo edit summary
 
(56 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|1.52|= Game version
|version1= 1.52


|arg= global |= Arguments in MP
|arg= global
____________________________________________________________________________________________


| Returns all magazines (including empty) from all vehicle turrets (including driver turret [-1]) and their ammo counts.  |= Description
|gr1= Turrets
____________________________________________________________________________________________


| '''magazinesAllTurrets''' vehicle|= Syntax
|descr= Returns all magazines (including empty) from all vehicle turrets (including driver turret [-1]) and their ammo counts. Since Arma 3 v2.08.148327 it is possible to exclude person turrets from returned results.


|p1= vehicle: [[Object]] - vehicle with turrets |= Parameter 1
|s1= [[magazinesAllTurrets]] vehicle


| [[Array]] - in the following format: <nowiki>[</nowiki>[className, turretPath, ammoCount, id, creator],...]  where:
|p1= vehicle: [[Object]] - vehicle with turrets
 
|r1= [[Array]] - in the following format: [<nowiki/>[className, turretPath, ammoCount, id, creator],...]  where:
* className: [[String]] - magazine class name
* className: [[String]] - magazine class name
* turretPath: [[Array]] - turret path
* turretPath: [[Array]] format [[Turret Path]]
* ammoCount: [[Number]] - how many rounds left in the magazine
* ammoCount: [[Number]] - how many rounds left in the magazine
* id: [[Number]] - id of the magazine object. The number starts at 10,000,000. This gives it about 7,600,000 possible ids before the number starts losing precision and cannot be used in scripts.
* id: [[Number]] - id of the magazine object. The number starts at 10,000,000. This gives it about 6,700,000 possible ids before the number starts losing precision and cannot be used in scripts.
* creator: [[Number]] - [[owner]] / [[clientOwner]] of the PC that created the object
* creator: [[Number]] - [[owner]] / [[clientOwner]] of the PC that created the object
|= Return value
____________________________________________________________________________________________
 
|x1= <code>_mags = [[magazinesAllTurrets]] [[vehicle]] [[player]];</code> |= Example 1
____________________________________________________________________________________________


| [[magazinesTurret]], [[allTurrets]], [[addMagazineTurret]], [[removeMagazinesTurret]], [[removeMagazineTurret]], [[weaponsTurret]], [[loadMagazine]], [[magazines]], [[magazinesDetail]], [[magazinesAmmo]], [[magazinesAmmoFull]], [[addWeaponTurret]], [[removeWeaponTurret]], [[turretLocal]] |= See also
|s2= [[magazinesAllTurrets]] [vehicle, excludePersonTurrets]


}}
|s2since= arma3 2.08
 
|p21= vehicle: [[Object]] - vehicle with turrets
 
|p22= excludePersonTurrets: [[Boolean]] - when [[true]] only vehicle's turrets are queried
 
|r2= [[Array]] - in the following format: [<nowiki/>[className, turretPath, ammoCount, id, creator],...]  where:
* className: [[String]] - magazine class name
* turretPath: [[Array]] format [[Turret Path]]
* ammoCount: [[Number]] - how many rounds left in the magazine
* id: [[Number]] - id of the magazine object. The number starts at 10,000,000. This gives it about 6,700,000 possible ids before the number starts losing precision and cannot be used in scripts.
* creator: [[Number]] - [[owner]] / [[clientOwner]] of the PC that created the object


<h3 style="display:none">Notes</h3>
|x1= <sqf>_mags = magazinesAllTurrets vehicle player;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|x2= <sqf>_mags = magazinesAllTurrets [vehicle player, true];</sqf>


[[Category:Arma 3: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
|seealso= [[magazinesTurret]] [[allTurrets]] [[addMagazineTurret]] [[removeMagazinesTurret]] [[removeMagazineTurret]] [[weaponsTurret]] [[loadMagazine]] [[magazines]] [[magazinesDetail]] [[magazinesAmmo]] [[magazinesAmmoFull]] [[addWeaponTurret]] [[removeWeaponTurret]] [[turretLocal]] [[getPylonMagazines]] [[ammoOnPylon]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 05:00, 27 November 2023

Hover & click on the images for description

Description

Description:
Returns all magazines (including empty) from all vehicle turrets (including driver turret [-1]) and their ammo counts. Since Arma 3 v2.08.148327 it is possible to exclude person turrets from returned results.
Groups:
Turrets

Syntax

Syntax:
magazinesAllTurrets vehicle
Parameters:
vehicle: Object - vehicle with turrets
Return Value:
Array - in the following format: [[className, turretPath, ammoCount, id, creator],...] where:
  • className: String - magazine class name
  • turretPath: Array format Turret Path
  • ammoCount: Number - how many rounds left in the magazine
  • id: Number - id of the magazine object. The number starts at 10,000,000. This gives it about 6,700,000 possible ids before the number starts losing precision and cannot be used in scripts.
  • creator: Number - owner / clientOwner of the PC that created the object

Alternative Syntax

Syntax:
magazinesAllTurrets [vehicle, excludePersonTurrets]
Parameters:
vehicle: Object - vehicle with turrets
excludePersonTurrets: Boolean - when true only vehicle's turrets are queried
Return Value:
Array - in the following format: [[className, turretPath, ammoCount, id, creator],...] where:
  • className: String - magazine class name
  • turretPath: Array format Turret Path
  • ammoCount: Number - how many rounds left in the magazine
  • id: Number - id of the magazine object. The number starts at 10,000,000. This gives it about 6,700,000 possible ids before the number starts losing precision and cannot be used in scripts.
  • creator: Number - owner / clientOwner of the PC that created the object

Examples

Example 1:
_mags = magazinesAllTurrets vehicle player;
Example 2:
_mags = magazinesAllTurrets [vehicle player, true];

Additional Information

See also:
magazinesTurret allTurrets addMagazineTurret removeMagazinesTurret removeMagazineTurret weaponsTurret loadMagazine magazines magazinesDetail magazinesAmmo magazinesAmmoFull addWeaponTurret removeWeaponTurret turretLocal getPylonMagazines ammoOnPylon

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