reload: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Replaced <code> with <sqf>)
mNo edit summary
Line 27: Line 27:


|s2= unit [[reload]] [muzzle, magazine]
|s2= unit [[reload]] [muzzle, magazine]
|s2since= Arma3 2.08
|s2since= {{GVI|arma3|2.08}}


|p21= unit: [[Object]] - person
|p21= unit: [[Object]] - person
|p22= muzzle (Optional): [[String]] - muzzle name or "" for current muzzle. Default: [[currentMuzzle]]
|p22= muzzle: [[String]] - (Optional, default [[currentMuzzle]]) muzzle name or "" for current muzzle.
|p23= magazine (Optional): [[String]] - magazine name or "" for given muzzle magazine. Default: given muzzle magazine. If given muzzle is [[currentMuzzle]] then [[currentMagazine]]
|p23= magazine: [[String]] - (Optional, default given muzzle magazine) magazine name or "" for given muzzle magazine. If given muzzle is [[currentMuzzle]] then [[currentMagazine]]


|r2= [[Boolean]] - [[true]] on success
|r2= [[Boolean]] - [[true]] on success

Revision as of 20:53, 28 September 2023

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, the behaviour is similar to player pressing "Reload" key. The command reloads the given muzzle but doesn't select it. In case of throwable muzzles, each throwable has own muzzle, they are autoreloaded after throw. Using reload on the trowable muzzle will just swap throwable for another one of the same type from inventory.
Groups:
Weapons

Syntax

Syntax:
reload unitName
Parameters:
unitName: Object
Return Value:
Nothing
<span class="gvi2 gvi-<span">-wrong parameter ("<span") defined!-[[:Category:Introduced with <span version class="gvi2 gvi-arma3">File:arma 3 logo black.png2.08|CLASS="GVI2 GVI-ARMA3">LINK=:CATEGORY:INTRODUCED WITH ARMA 3 VERSION 2.082.08]]

Alternative Syntax

Syntax:
unit reload [muzzle, magazine]
Parameters:
unit: Object - person
muzzle: String - (Optional, default currentMuzzle) muzzle name or "" for current muzzle.
magazine: String - (Optional, default given muzzle magazine) magazine name or "" for 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"];
Example 3:
Reload current muzzle:
player reload [];

Additional Information

See also:
reloadEnabled needReload enableReload setWeaponReloadingTime

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