---
name: "setWeaponZeroing"
type: command
status: ok
groups: ["Weapons"]
arma3_since: "2.04"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/setWeaponZeroing
revid: 348618
updated: 2023-11-08T13:45:39Z
---

# setWeaponZeroing

*Command · Weapons · Arma 3 v2.04*

## Description

Sets zeroing of given weapon and muzzle for given unit or vehicle.

## Syntax

```sqf
object setWeaponZeroing [weaponClass, muzzleClass, zeroingIndex]
```

**Parameters:**

- `object`: [Object](../topics/Object.md) - unit or vehicle
- `weaponClass`: [String](../topics/String.md) - class name of weapon
- `muzzleClass`: [String](../topics/String.md) - class name of the muzzle
- `zeroingIndex`: [Number](../topics/Number.md) - zeroing index. See [currentZeroing](../commands/currentZeroing.md)

**Returns:** [Boolean](../topics/Boolean.md) - [true](../commands/true.md) if successful, otherwise [false](../commands/false.md) is returned (e.g. weapon, muzzle, or zeroing index is invalid)

## Examples

### Example 1

```sqf
player setWeaponZeroing ["arifle_MX_GL_F", "GL_3GL_F", 8]; // Set zeroing for underbarrel grenade launcher to 400m
```

## See also

[currentZeroing](../commands/currentZeroing.md)

<sub>Source: [BI Community Wiki — setWeaponZeroing](https://community.bistudio.com/wiki/setWeaponZeroing) (revision 348618).</sub>
