Arma 3 Scripting

currentWeapon

  • Arma 3 v0.50
  • First in Arma 2 v1.00

Command · also in Unit Inventory · Markdown · JSON · original wiki page

Description

Return the name of the currently selected weapon (on the primary turret for vehicles).

Syntax

currentWeapon vehicle

Parameters:

Returns: String

Examples

Example 1

_weaponClass = currentWeapon (vehicle player);//Example: "M16A2GL"

Example 2

_weaponClass = currentWeapon player;

See also

currentMagazine · currentMuzzle · currentThrowable · currentVisionMode · currentWeaponMode · currentZeroing · magazinesTurret · weaponsTurret · currentWeaponTurret · weaponState

Community notes

Lou Montana

You have to make a little delay (sleep 0.001; (not less)) to use this command, else you will be returned an empty string.

Lou Montana

It seems it is not working in 1.02 for other unit than player.

Terox

This works for vehicles providing there is a gunner