> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pandryx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MedMask

***

<Frame>
  <img src="https://mintcdn.com/pandryxstuidos/5Lprjxnm9aZ0w2Ww/images/Pandryx_Medical.png?fit=max&auto=format&n=5Lprjxnm9aZ0w2Ww&q=85&s=af8855fc6ea3144f3db4a7990725da1e" alt="Pandryx Medical" width="1920" height="1080" data-path="images/Pandryx_Medical.png" />
</Frame>

\
**Installation**

1. Unzip **Pandryx\_MedMask** and place **Pandryx\_MedMask** in your server’s resources folder.
2. Add **ensure Pandryx\_MedMask**  to your **server.cfg**
3. Start / Restart your server

   <Note>
     This step is **optional** and only required if you want players to **use the mask as an inventory item**.
   </Note>

   <CodeGroup>
     ```text ESX theme={null}
     INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`)
     VALUES ('mask', 'Medical Mask', 0, 0, 1);
     ```
   </CodeGroup>

   <CodeGroup>
     ```text QB theme={null}
     QBCore does not use SQL items by default.
     Open: qb-core/shared/items.lua
     Add the following item:
     ["mask"] = {
         name = "mask",
         label = "Medical Mask",
         weight = 0,
         type = "item",
         image = "mask.png",
         unique = false,
         useable = true,
         shouldClose = true,
         description = "A medical face mask."
     },
     Make sure the item image exists in: qb-inventory/html/images/
     ```

     ```text ox_inventory theme={null}
     Open: ox_inventory/data/items.lua
     Add the item:
     ['mask'] = {
         label = 'Medical Mask',
         weight = 0,
         stack = true,
         close = true,
         description = 'A medical face mask.'
     },
     Drop the item image at: ox_inventory\web\images
     ```
   </CodeGroup>

**Framework**

Defines which framework the script uses.

Supported Frameworks:

* Auto - Detect Automatically
* ESX
* QBCORE
* QBOX

<CodeGroup>
  ```lua Framework theme={null}
  Config.Framework = "auto"
  ```
</CodeGroup>

**Command**

The command players use to toggle the mask.

```text theme={null}
Config.Command = "emask"
```

<Warning>
  Modifying the command may result in conflicts or cause the script to malfunction. Always use `/emask` to ensure reliable and consistent functionality.
</Warning>

**Item Usage**

Allows the mask to be used as an **inventory item** instead of only a command.

```text theme={null}
Config.Item = {
    Enabled = false,
    Name = "mask",
    Label = "Medical Mask"
}
```

**Mask Settings**

Controls which mask component is applied to the player.

```text theme={null}
Config.Mask = {
    Component = 1,
    Drawable = 33,
    Texture = 0,
    RemoveDrawable = 0,
    RemoveTexture = 0
}
```

**Job Restrictions**

Limits mask usage to specific jobs.

```text theme={null}
Config.JobRestriction = {
    Enabled = true,

    Jobs = {
        police = true,
        ambulance = true
    }
}
```

**Mask Blocker**

Prevents players from equipping specific masks while this script is active.

```text theme={null}
Config.MaskBlocker = {

    Enabled = true,
    Notify = true,
    CheckInterval = 1000,

    Blocks = {
        {Slot = 1, Drawable = 33}
    }

}
```

**Animation**

Animation played when putting on the mask.

```text theme={null}
Config.Animation = {
    Dict = "mp_masks@standard_car@ds@",
    Name = "put_on_mask",
    Duration = 1200
}
```

**Cooldown**

Adds a cooldown between mask usage.

```text theme={null}
Config.Cooldown = {
    Enabled = true,
    Time = 5000
}
```

**Notifications**

Messages shown to players when using the mask.

```text theme={null}
Config.NotifyOn = "You put on your medical mask"
Config.NotifyOff = "You removed your medical mask"
Config.NoPermission = "You are not authorised to use this"
```

**Notification Type**

<CodeGroup>
  ```text Framework theme={null}
  Config.Notification = {
      Type = "auto"
  }
  ```

  ```text Pandryx GlowNotify theme={null}
  Config.Notification = {
      Type = "custom",
      CustomNotifyTrigger = function(msg)
  		exports["Pandryx_Notify"]:SendNotification({
  			type     = "info",
  			title    = "Pandryx MedicalMask",
  			message  = msg,
  			duration = 5000,
  			progress = true,
  			sound    = "pop.wav",
  			position = "bottom-center",
  		})
      end
  }
  ```

  ```text Mythic Notify theme={null}
  Config.Notification = {
      Type = "custom"
  	CustomNotifyTrigger = function(msg)
          exports['mythic_notify']:DoHudText('inform', msg)
      end
  }
  ```

  ```text Custom theme={null}
  Config.Notification = {
      Type = "custom"
  	CustomNotifyTrigger = function(msg)
          exports['custom_notification']:sendNotification(msg)
      end
  }
  ```
</CodeGroup>

**Keybind**

```text theme={null}
Config.Keybind = {
    Enabled = false,
    Key = 288 -- F1 
}
```

**Remove Mask on Respawn**

Automatically removes the mask when the player respawns.

```text theme={null}
Config.RemoveOnRespawn = {
    Enabled = true
}
```
