> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/gta-dual-wield-two-handed-weapons/reference/commands-and-controls.md).

# Commands & Controls

***

### Player controls

| Input             | Action                                      |
| ----------------- | ------------------------------------------- |
| Mouse wheel click | Aim, raises both weapons                    |
| Left click        | Fire left gun, or both in unified mode      |
| Right click       | Fire right gun, or aim only in unified mode |
| `X`               | Toggle fire mode                            |
| `M`               | Put the dual guns away                      |

`X` and `M` are registered through `ox_lib`, so players can rebind them in the FiveM keybind settings under **rm\_dualgun**.

***

### Fire modes

Toggled in game with `X`. The current mode is shown on the ammo HUD.

#### Mode 1: Independent (default)

| Button      | Result          |
| ----------- | --------------- |
| Left click  | Left gun fires  |
| Right click | Right gun fires |

Each hand runs its own magazine and fire-rate timer. Best for combined duals, where the two sides behave very differently.

#### Mode 2: Unified

| Button      | Result         |
| ----------- | -------------- |
| Left click  | Both guns fire |
| Right click | Aim only       |

Simpler to use, and closer to how dual-wielding usually feels in shooters.

***

### Aim behaviour

There is a short delay between raising the guns and the first shot being allowed, and the aim pose is held briefly after you release the button. This keeps the animation from snapping in and out during rapid taps.

***

### Commands

| Command                | Access  | Purpose                                         |
| ---------------------- | ------- | ----------------------------------------------- |
| `/useDual <weaponKey>` | Testing | Spawn a dual gun with full ammo, no item needed |
| `/undual`              | Player  | Put the dual guns away                          |
| `/dualdiag`            | Support | Print a state snapshot for support tickets      |

#### `/useDual`

```
/useDual rm_chaos_dual
```

Bypasses inventory ownership entirely, which makes it the fastest way to confirm your install works. Ammo spent this way is never saved.

{% hint style="danger" %}
`/useDual` is not restricted by default. Before going live, either remove the command or gate it behind an ace permission so players cannot give themselves weapons.
{% endhint %}

#### `/dualdiag`

Prints a diagnostic snapshot to the F8 console. If you open a support ticket, run this and include the output. It identifies most issues immediately.

***

### Integration hook

Other resources can check whether a player is currently dual-wielding, and with what:

```lua
-- Server side
local dg = Player(playerId).state.dualGun
if dg then
    print(dg.weaponKey)   -- e.g. 'rm_chaos_dual'
end
```

```lua
-- Client side, for any player
local dg = Player(serverId).state.dualGun
local isDualWielding = dg ~= nil
```

Useful for weapon-restricted zones, HUD integrations, job checks and logging.

{% hint style="warning" %}
Read only. Writing to this value from another resource will desync the player's weapons.
{% endhint %}

***

### Localisation

All player-facing text lives in `locales/`. `en.json` is the reference file:

```json
{
    "out_of_ammo": "Out of ammo",
    "guns_full": "Both guns are already full",
    "ammo_loaded": "Loaded %d into L, %d into R"
}
```

To add a language, copy `en.json` to a new file named after the locale code, replace the **values** while leaving the keys untouched, then point `cfg.lua` at it on the first line:

```lua
lib.locale('de')   -- loads locales/de.json
```

{% hint style="warning" %}
Keep the `%d` placeholders and their order. They are filled in at runtime, so removing one or swapping their positions will produce wrong numbers or an error.
{% endhint %}
