# Masks & disguises

Decide which clothing hides a face and which makes someone a stranger.

## How clothing affects recognition

Every time a player holds the reveal key, the clothing each nearby person is wearing decides what is shown:

| Wearing | Shown | Can be remembered |
| --- | --- | --- |
| Nothing that hides the face | Your alias, or **Unknown** if you have not remembered them | Yes |
| A **disguise**, such as a fake beard or wig | **Unknown**, even if you remember them | No |
| A **covering**, such as a mask or helmet | **Face covered** | No |

A covering always wins over a disguise. Someone wearing both shows **Face covered**; take off the covering and they show **Unknown**; take off the disguise too and your alias comes back.

Clothing never deletes a memory. Ordinary haircuts, hair colour and real facial hair do not affect recognition.

## Masks

Masks work out of the box on the two freemode models:

```lua config.lua
Config.Masks = {
    mp_m_freemode_01 = { slot = 1, empty = { 0 } },
    mp_f_freemode_01 = { slot = 1, empty = { 0 } },
}
```

`slot = 1` is the mask component, and `empty` lists the drawables that mean *no mask*. Every other drawable in that slot, in any texture, is a covering. You do not need to list your masks.

Only add a drawable to `empty` if it really shows the whole face. Do not add one because a mask looks small or decorative.

## Custom ped models

Any model that is not in `Config.Masks` always shows **Face covered** and cannot be remembered. Add each model your players use, with its tested no-mask drawables:

```lua config.lua
Config.Masks.my_custom_ped = { slot = 1, empty = { 0, 3 } }
```

For a model that has no mask component at all:

```lua config.lua
Config.Masks.my_fixed_ped = { noMaskComponent = true }
```

## Add coverings and disguises

`Config.ClothingRules` adds other clothing. Each rule describes one item on one ped model:

| Field | Required | What it means |
| --- | --- | --- |
| `model` | Yes | Ped model, such as `'mp_m_freemode_01'` |
| `kind` | Yes | `'component'` for clothing, `'prop'` for hats, glasses and ear pieces |
| `slot` | Yes | Component or prop slot number |
| `drawable` | Yes | The item's drawable number |
| `texture` | No | One texture only. Leave it out to match every texture |
| `collection` | No | Clothing pack name. When set, `drawable` is the number inside that pack |
| `classification` | Yes | `'covering'` (shows Face covered) or `'disguise'` (shows Unknown) |

Common slots:

| Kind | Slot | Contains |
| --- | --- | --- |
| Component | 1 | Masks |
| Component | 2 | Hair |
| Component | 7 | Accessories |
| Component | 11 | Tops |
| Prop | 0 | Hats and helmets |
| Prop | 1 | Glasses |
| Prop | 2 | Ear pieces |

Custom clothing can use other slots. Some examples; the numbers are illustrative, so replace them with items installed on your server:

```lua config.lua
Config.ClothingRules = {
    -- A full-face helmet
    { model = 'mp_m_freemode_01', kind = 'prop', slot = 0, drawable = 123, classification = 'covering' },
    -- Dark glasses, only in texture 2
    { model = 'mp_f_freemode_01', kind = 'prop', slot = 1, drawable = 99, texture = 2, classification = 'covering' },
    -- A hooded top from a clothing pack
    { model = 'mp_m_freemode_01', kind = 'component', slot = 11, collection = 'your_clothing_pack', drawable = 4, classification = 'covering' },
    -- A wig from a clothing pack
    { model = 'mp_f_freemode_01', kind = 'component', slot = 2, collection = 'your_wig_pack', drawable = 1, classification = 'disguise' },
    -- A fake beard that sits in the mask slot
    { model = 'mp_m_freemode_01', kind = 'component', slot = 1, collection = 'your_fake_beard_pack', drawable = 0, classification = 'disguise' },
}
```

A fake beard or moustache often uses the mask slot, where it would normally count as a mask. A disguise rule for that exact item makes it show **Unknown** instead. Add rules only for specific fake items; never for the whole hair slot.

Male and female models need separate rules, even for the same item.

## Use collections for add-on clothing

Global drawable numbers move when you add, remove or reorder clothing packs. A rule with `collection` keeps matching the right item, because it uses the pack's name and the item's number inside that pack. Base-game clothing is in the collection `''`.

Use `collection` for any add-on clothing.

## Find an item's numbers

Put the item on in game, then run this from a development resource or a client console tool. Change `slot` to the one you are checking:

```lua
local ped, slot = PlayerPedId(), 11
local drawable = GetPedDrawableVariation(ped, slot)
print(drawable, GetPedTextureVariation(ped, slot),
    GetPedCollectionNameFromDrawable(ped, slot, drawable),
    GetPedCollectionLocalIndexFromDrawable(ped, slot, drawable))
```

It prints the global drawable, texture, collection name and the number inside that collection. For props, use `GetPedPropIndex`, `GetPedPropTextureIndex`, `GetPedCollectionNameFromProp` and `GetPedCollectionLocalIndexFromProp`. An empty prop slot is `-1`; skip the collection lookup for it.

## Helmet visors

Raising a visor usually does not change the helmet's drawable or texture, so a helmet configured as a covering hides the face with its visor up or down.

## Test your rules

Restart the resource after changing rules, then with a second player:

1. Put on each item. Holding the key shows **Face covered** or **Unknown** as configured.
2. For rules with a `texture`, try another texture of the same item. It should not match.
3. Take everything off. Your alias comes back within a second or two while you hold the key.

If a rule never matches, check the model, `kind` and slot first, then whether the item comes from a clothing pack and needs `collection`. A rule with an invalid `kind` or `classification`, or without `slot` or `drawable`, stops the resource on start with an error in the console.
