canFire

From Bohemia Interactive Community
Revision as of 17:57, 9 January 2015 by Killzone Kid (talk | contribs) (more clarification)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Returns 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 cannot be damaged >= 0.9 but can be empty due to running out of ammo. If mission starts with vehicle having no ammo or setVehicleAmmo 0 command is executed on the vehicle, then canFire will always report false for it.
Groups:
Uncategorised

Syntax

Syntax:
canFire unitName
Parameters:
unitName: Object
Return Value:
Boolean - true if able to fire

Examples

Example 1:
?!(canFire _tank) : player sideChat "Tank disabled!"
Example 2:
if (!(canFire _tank)) then { player sideChat "Tank disabled!"; };

Additional Information

See also:
canMovecanStand

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

Notes

Posted on 07:16, 20 January 2007 (CEST)
Bdfy
true even if unit is out of ammo. Only false if gun is damaged.
Posted on 05:20, 24 August 2008 (CEST)
Canukausiuka
False if there is no gunner in the vehicle, regardless of damage level.

Bottom Section