reload: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 19: Line 19:


|descr= * Old syntax: Reload first found muzzle that needs reloading (with some inconsistencies).  
|descr= * Old syntax: Reload first found muzzle that needs reloading (with some inconsistencies).  
* Alternative syntax: This syntax allows to reload given muzzle with given magazine while playing proper animation. If param is omitted or is empty string, default value is used. The default behaviour is to find best matching magazine for given muzzle from the pool of available magazines. If specific magazine is requested, the reload will fail if unit has run out of this type of magazines. If empty array is given, behaviour is similar to player pressing "Reload" key.
* Alternative syntax (Since Arma 3 v2.08.148609): This syntax allows to reload given muzzle with given magazine while playing proper animation. If param is omitted or is empty string, default value is used. The default behaviour is to find best matching magazine for given muzzle from the pool of available magazines. If specific magazine is requested, the reload will fail if unit has run out of this type of magazines. If empty array is given, behaviour is similar to player pressing "Reload" key.


|s1= [[reload]] unitName
|s1= [[reload]] unitName

Revision as of 21:06, 1 January 2022

Hover & click on the images for description

Description

Description:
  • Old syntax: Reload first found muzzle that needs reloading (with some inconsistencies).
  • Alternative syntax (Since Arma 3 v2.08.148609): This syntax allows to reload given muzzle with given magazine while playing proper animation. If param is omitted or is empty string, default value is used. The default behaviour is to find best matching magazine for given muzzle from the pool of available magazines. If specific magazine is requested, the reload will fail if unit has run out of this type of magazines. If empty array is given, behaviour is similar to player pressing "Reload" key.
Groups:
Weapons

Syntax

Syntax:
reload unitName
Parameters:
unitName: Object
Return Value:
Nothing

Alternative Syntax

Syntax:
unit reload [muzzle, magazine]
Parameters:
unit: Object - person
muzzle (Optional): String - muzzle name or "" for current muzzle. Default: currentMuzzle
magazine (Optional): String - magazine name or "" for given muzzle magazine. Default: given muzzle magazine. If given muzzle is currentMuzzle then currentMagazine
Return Value:
Boolean - true on success

Examples

Example 1:
if (needReload player == 1) then { reload player };
Example 2:
player reload ["GL_3GL_F", "1Rnd_HE_Grenade_shell"];

Additional Information

See also:
reloadEnabledneedReloadenableReloadsetWeaponReloadingTime

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