needReload: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]2(\|.*)\]\]" to "{{GameCategory|arma2|Scripting Commands}}")
No edit summary
 
(40 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma1 |Game name=
|game1= arma1
|version1= 1.00


|1.00|Game version=
|game2= arma2
|version2= 1.00


|gr1= Weapons |GROUP1=
|game3= arma2oa
____________________________________________________________________________________________
|version3= 1.50


| Return how much vehicle wants to reload its weapons. |DESCRIPTION=
|game4= tkoh
____________________________________________________________________________________________
|version4= 1.00


| '''needReload''' vehicle |SYNTAX=
|game5= arma3
|version5= 0.50


|p1= vehicle: [[Object]] |PARAMETER1=
|gr1= Weapons


| [[Number]] Range: 0-1, 0: full mag, 1: empty mag  |RETURNVALUE=
|descr= Returns how much vehicle wants to reload its weapons.
____________________________________________________________________________________________
|x1=<code>_seriousness = '''needReload''' _vehicle;</code> |EXAMPLE1=
|x2=<code>[[if]] ([[needReload]] [[player]] == 1) [[then]] {'''reload''' [[player]]};</code> |EXAMPLE2=


| [[reload]], [[reloadEnabled]], [[enableReload]] |SEEALSO=
|s1= [[needReload]] entity


}}
|p1= entity: [[Object]] - unit or vehicle
 
|r1= [[Number]] - range: 0-1, 0: full mag, 1: empty mag
 
|s2= entity [[needReload]] muzzle
|s2since= arma3 2.22


<h3 style="display:none">Notes</h3>
|p21= entity: [[Object]] - unit or vehicle
<dl class="command_description">
|p22= muzzle: [[String]] - muzzle to check. "" to check all muzzles
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|r2= [[Number]] - range: 0-1, 0: full mag, 1: empty mag
</dl>


<h3 style="display:none">Bottom Section</h3>
|x1= <sqf>_seriousness = needReload _vehicle;</sqf>


[[Category:Scripting Commands|NEEDRELOAD]]
|x2= <sqf>if (needReload player == 1) then { reload player };</sqf>
{{GameCategory|arma1|Scripting Commands}}
|x3= <sqf>player needReload currentMuzzle player;</sqf>
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
|seealso= [[needService]] [[reload]] [[reloadEnabled]] [[enableReload]]
<dl class="command_description">
}}
<dd class="notedate">Posted on July 3, 2019 - 23:05 (UTC)</dd>
<dt class="note">[[User:demellion|demellion]]</dt>
<dd class="note">
It seems that for [[player]] it always returns 1
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 12:29, 14 October 2025

Hover & click on the images for description

Description

Description:
Returns how much vehicle wants to reload its weapons.
Groups:
Weapons

Syntax

Syntax:
needReload entity
Parameters:
entity: Object - unit or vehicle
Return Value:
Number - range: 0-1, 0: full mag, 1: empty mag

Alternative Syntax

Syntax:
entity needReload muzzle
Parameters:
entity: Object - unit or vehicle
muzzle: String - muzzle to check. "" to check all muzzles
Return Value:
Number - range: 0-1, 0: full mag, 1: empty mag

Examples

Example 1:
_seriousness = needReload _vehicle;
Example 2:
if (needReload player == 1) then { reload player };
Example 3:

Additional Information

See also:
needService reload reloadEnabled enableReload

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