isWeaponDeployed: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{Note([^<]*)<code>([^<]*)<\/code>" to "{{Note$1<sqf>$2</sqf>")
m (Some wiki formatting)
 
Line 22: Line 22:
|p21= unit: [[Object]]
|p21= unit: [[Object]]


|p22= onGround (Optional): [[Boolean]] - [[true]] to check if deployed on ground, [[false]] to check if deployed on object. Omitted - same as main syntax.
|p22= onGround: [[Boolean]] - (Optional) [[true]] to check if deployed on ground, [[false]] to check if deployed on object. Omitted - same as main syntax.


|r2= [[Boolean]]  
|r2= [[Boolean]]  
Line 28: Line 28:
|x1= <sqf>_dep = isWeaponDeployed player;</sqf>
|x1= <sqf>_dep = isWeaponDeployed player;</sqf>


|x2= <code>_depOnObj = isWeaponDeployed <nowiki>[</nowiki>player, false];</code>
|x2= <sqf>_depOnObj = isWeaponDeployed [player, false];</sqf>


|seealso= [[isWeaponRested]] [[canDeployWeapon]]
|seealso= [[isWeaponRested]] [[canDeployWeapon]]

Latest revision as of 14:54, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns true if weapon is currently deployed.
Groups:
Weapons

Syntax

Syntax:
isWeaponDeployed unit
Parameters:
unit: Object
Return Value:
Boolean

Alternative Syntax

Syntax:
isWeaponDeployed [unit, onGround]
Parameters:
unit: Object
onGround: Boolean - (Optional) true to check if deployed on ground, false to check if deployed on object. Omitted - same as main syntax.
Return Value:
Boolean

Examples

Example 1:
_dep = isWeaponDeployed player;
Example 2:
_depOnObj = isWeaponDeployed [player, false];

Additional Information

See also:
isWeaponRested canDeployWeapon

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
AgentRev - c
Posted on Jul 01, 2015 - 16:44 (UTC)
You can force a unit out of bipod or resting with:
_unit playMove "";
Beno 83au - c
Posted on Mar 04, 2017 - 03:58 (UTC)
playMove, as well as switchMove, appears to not work when forcing a player out of being deployed. A more reliable method is:
_player setPos (_player modelToWorld [0,0,0]);