hasWeapon: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Command|= Comments | |||
____________________________________________________________________________________________ | |||
| ofp |= Game name | |||
|1.00|= Game version | |||
|arg= global |= Arguments in MP | |||
____________________________________________________________________________________________ | |||
| Checks if a unit has the given weapon. |= Description | |||
____________________________________________________________________________________________ | |||
''' | | unit '''hasWeapon''' weapon |= Syntax | ||
|p1= unit: [[Object]] |= Parameter 1 | |||
|p2= weapon: [[String]] - the name of the weapon to check for. |= Parameter 2 | |||
[[Boolean]] | | [[Boolean]] - | ||
Returns true if the unit has the weapon, false if not. |= Return value | |||
____________________________________________________________________________________________ | |||
|x1= <pre>?!(player hasWeapon "M16") : player addWeapon "M16"</pre> |= Example 1 | |||
____________________________________________________________________________________________ | |||
| [[weapon]] |= See also | |||
}} | |||
<h3 style="display:none">Notes</h3> | |||
<dl class="command_description"> | |||
<!-- Note Section BEGIN --> | |||
<!-- Note Section END --> | |||
</dl> | |||
<h3 style="display:none">Bottom Section</h3> | |||
[[Category:Scripting Commands|HASWEAPON]] | |||
[[Category:Scripting Commands OFP 1.96|HASWEAPON]] | |||
[[Category:Scripting Commands OFP 1.46|HASWEAPON]] | |||
[[Category:Scripting Commands ArmA|HASWEAPON]] |
Revision as of 00:28, 2 August 2006
Description
- Description:
- Checks if a unit has the given weapon.
- Groups:
- Uncategorised
Syntax
- Syntax:
- unit hasWeapon weapon
- Parameters:
- unit: Object
- weapon: String - the name of the weapon to check for.
- Return Value:
- Boolean - Returns true if the unit has the weapon, false if not.
Examples
- Example 1:
?!(player hasWeapon "M16") : player addWeapon "M16"
Additional Information
- See also:
- weapon
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