> For the complete documentation index, see [llms.txt](https://aero-labs.gitbook.io/aero-labs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aero-labs.gitbook.io/aero-labs-docs/scripts/abvm.md).

# ABvm

Ventilate a patient with a bag valve mask, with custom animations, prop and squeeze sound.

![ABvm](https://3178353394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm2Hc1pmEtJtEBI0blIeE%2Fuploads%2Fd560cRSpBDMUjpAqUZOs%2FABvm.jpg?alt=media)

A bag valve mask (BVM) for EMS roleplay. The medic kneels at the patient's head and holds the mask in place, and every squeeze plays a sound that nearby players hear.

## Requirements

| Dependency                                        | Required | Notes                                         |
| ------------------------------------------------- | -------- | --------------------------------------------- |
| [ox\_lib](https://github.com/overextended/ox_lib) | Yes      | Notifications                                 |
| A sound system                                    | Yes      | `evo_sound_addon`, InteractSound, or TMC core |
| QBCore / TMC                                      | Optional | Only needed to use the BVM as an item         |

The BVM prop and both animations are streamed by the resource itself.

## Installation

1. Drag the `ABvm` folder into your `resources` folder.
2. Add it to your `server.cfg` after ox\_lib:

   ```cfg
   ensure ox_lib
   ensure ABvm
   ```
3. Set up the squeeze sound for your sound system (see **Sound setup** below) and set `Config.SoundSystem` to match.
4. **Framework only:** add a `bvm` item to your inventory.

### Sound setup

{% tabs %}
{% tab title="evo\_sound" %}
Nothing to copy. The sound plays straight from `ABvm/sounds/bvmSqueeze.ogg`. Make sure `evo_sound_addon` is started.

```lua
Config.SoundSystem = "evo_sound"
```

{% endtab %}

{% tab title="InteractSound" %}
Copy `ABvm/sounds/bvmSqueeze.ogg` to `interact-sound/client/html/sounds/`.

```lua
Config.SoundSystem = "InteractSound"
```

{% endtab %}

{% tab title="TMC" %}
Copy `ABvm/sounds/bvmSqueeze.ogg` to `core_game/html/client/`.

```lua
Config.SoundSystem = "TMC"
```

{% endtab %}
{% endtabs %}

## Configuration

```lua
Config.Debug = true

Config.Framework = "QBCore" -- "Standalone", "QBCore", "TMC"

Config.ItemName = "bvm" -- Ignored in Standalone
Config.Command = {
    enabled = false, -- Set to true for Standalone
    command = "usebvm",
}

Config.SoundName   = "bvmSqueeze" -- name of the .ogg file, without extension
Config.UseCam      = false        -- cinematic close-up camera for both players
Config.SoundSystem = "evo_sound"  -- "evo_sound", "InteractSound", "TMC"
Config.MeMessage   = true         -- sends "/me Oxygenating patient" on each squeeze
```

| Option               | Description                                                                           |
| -------------------- | ------------------------------------------------------------------------------------- |
| `Config.SoundSystem` | Which system plays the squeeze sound. Must match your sound setup.                    |
| `Config.UseCam`      | Switches both medic and patient to a close-up camera while ventilating.               |
| `Config.MeMessage`   | Posts a `/me` action on every squeeze. Turn it off if you don't have a `/me` command. |
| `Config.Debug`       | Prints debug output. Set to `false` on a live server.                                 |

## Usage

1. Use the **bvm** item, or type `/usebvm` in Standalone.
2. Look at the patient. A **yellow marker** appears above their head.
3. Press **E** to select them (**Esc** cancels).
4. You kneel at the patient's head with the mask, and the patient is moved into position.
5. Press **E** to squeeze the bag. Each press plays the squeeze sound.
6. Press **X** to stop and put the BVM away.

## Developer events

| Event (client)         | Description                         |
| ---------------------- | ----------------------------------- |
| `MDXBvm:Client:UseBvm` | Starts target selection and BVM use |
