Weapons
53 scripting commands. Also as Markdown for agents.
- aimedAtTargetReturns how good a vehicle's weapon is aimed at the target.
- canDeployWeaponReturns true if a unit's weapon can be deployed.
- canFireReturns true if the given vehicle is still able to fire. For the command to return true, vehicle must be alive, have weapon operator and the weapon…
- compatibleItemsReturns all items (attachments) that can be mounted on the given weapon.
- compatibleMagazinesReturns all magazines that can be loaded in the given weapon or all magazines containing the provided ammo. No compatible magazines are returned for…
- compatibleWeaponsReturns all compatible weapons for given weapon item, weapon magazine or weapon slot.
- currentMuzzleReturns a unit's current weapon muzzle. Does not work on vehicles.
- currentThrowableReturns currently selected throwable (and the muzzle it is loaded into), which will be launched if the user presses <kbd>G</kbd>.
- currentVisionModeReturns current vision mode of unit's weapon. Vision mode could be one of: - 0 - normal vision - 1 - night vision - 2 - thermal vision Alternative…
- currentWeaponReturn the name of the currently selected weapon (on the primary turret for vehicles).
- currentWeaponModeReturns current weapon mode of unit's weapon.
- currentZeroingReturns current zeroing.
- disableNVGEquipmentEnables or disables transport NV (Night Vision). To disable TI (Thermal Imaging) use disableTIEquipment.
- disableTIEquipmentDisables TI (Thermal Imaging) equipment for given vehicle.
- enableGunLightsToggles the target group's gun lights. disableAI "LIGHTS" will disable the use of gun lights.
- enableIRLasersAllows the AI to use IR lasers. Units should be in "Combat" behaviour.
- enableReloadEnable / disable auto-reload (including AI) when magazine is empty. Default - enabled.
- enableWeaponDisassemblyEnables or disables disassembly of static weapons. Could be applied to local player, to another unit or to static weapon directly.
- fireForces a unit to fire the given weapon.
- fireAtTargetRemotely forces a unit to fire the given weapon. See also BIS_fnc_fire.
- forceWeaponFireThe unit will be forced to fire weapon from the given muzzle. The weapon will not fire if firemode passed as parameter is not supported by the given…
- getShotParentsReturns shot information for the given projectile. If shot was fired by a soldier on foot or in FFV position in vehicle, the soldier is returned for…
- getWeaponSwayReturns current size of weapon sway of a given unit, in radians. This command may still return a value greater 0 even if sway was effectively set to…
- hasWeaponChecks if a unit has the given weapon in hands or on back/in holster. Weapons inside unit containers such as vest and backpack are not counted.
- isFlashlightOnReturns true if there is a linked and enabled flashlight on a given weapon.
- isLaserOnReturns true if the vehicle has its laser turned on. Not to be confused with isIRLaserOn which is for units. Main syntax is for primary gunner turret.
- isManualFireReturns true if manual fire is on. Manual fire could either be selected in vehicle action menu (if available) or with action "ManualFire" and…
- isThrowableReturns true if the given magazine is a throwable.
- isWeaponDeployedReturns true if weapon is currently deployed.
- isWeaponRestedReturns true if weapon is currently rested.
- laserTargetReturns the laser target object created by given unit (vehicle or soldier) when using a laser targeting device. The main syntax targets the primary…
- loadMagazineInitiates the loading action on given weapon of the turret of a transport. So the new magazine is not available instantly, yet according to the…
- missileStateGet the provided *guided* missile's engine, target lock and flight profile states.
- missileTargetReturns a guided missile's target.
- missileTargetPosReturns a guided missile's target position.
- needReloadReturns how much vehicle wants to reload its weapons.
- reloadMain syntax: Reload first found muzzle that needs reloading (with some inconsistencies).
- reloadEnabledA getter for enableReload. The value returned is wether or not auto-reload is enabled for current client only.
- selectThrowableSelects current throwable, which will be launched if the user presses <kbd>G</kbd>.
- selectWeaponSelects the given weapon.
- setMissileTargetSets a guided missile target. Does not work for all types of missiles. If the target is dead, it is ignored. The target has to be inside the…
- setMissileTargetPosSets a guided munition target position. The munition must have `manualControl` config entry to use this command. The target position has to be inside…
- setShotParentsSets vehicle and instigator pair for the given projectile.
- setWeaponReloadingTimeSets reloading phase on the given weapon's current ammo round.
- setWeaponZeroingSets zeroing of given weapon and muzzle for given unit or vehicle.
- throwablesReturns all throwables in unit inventory in currentThrowable format.
- weaponDirectionReturns the direction that the vehicle weapon is aiming in. For addons the weapon name must be an entry in CfgWeapons.
- weaponDisassemblyEnabledReturns if weapon disassembly is enabled. As disassembly can be enabled/disabled on both player and weapon, it might be necessary to check both.
- weaponInertiaReturns current rate of how much the weapon view is distorted because of quick aiming.
- weaponLoweredReturns true if given soldier's weapon is lowered.
- weaponReloadingTimeReturns current ammo round reloading phase. For a magazine reloading phase see weaponState command.
- weaponsInfoReturns entity's weapons information including weapon index and firemode.
- weaponStateReturns the given or currently selected weapon state for unit or vehicle. With #Syntax 2, if no optional arguments are present, currently selected…