Jump to navigation Jump to search
- Returns entity's weapons information including weapon index and firemode.
- unit weaponsInfo [weaponOrMuzzle, onlyLoaded]
- unit: Object - person
- weaponOrMuzzle: String - name of the weapon or muzzle (returns whichever matches first) or "" to return all weapons
- onlyLoaded: Boolean - (Optional, default false) true to return loaded weapons only
- Return Value:
- Array of Arrays (or an empty ) - weapons information in format [[weaponIndex, isSelected, weaponName, muzzleName, firemode, magazineName, ammoCount], ...] where:
- weaponIndex: Number - internal weapon index (changes frequently) used with "SwitchWeapon" and "UseWeapon" actions
- isSelected: Boolean - true if this weapon is currently selected
- weaponName: String - weapon name
- muzzleName: String - muzzle name
- firemode: String - firemode that is set for this 'weaponIndex'
- magazineName: String - name of the loaded magazine or ""
- ammoCount: Number - magazine ammo count or -1
- Example 1:
- Find weapon with FullAuto firemode and switch to it: