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

# Configuration

Two files: `config.lua` for the block itself, `server_config.lua` for the bypass list and Discord logging. Both ship commented.

### config.lua

| Setting                  | Default | Description                                                                                     |
| ------------------------ | ------- | ----------------------------------------------------------------------------------------------- |
| `Config.Locale`          | `'en'`  | Language of every text. `'en'` or `'de'`.                                                       |
| `Config.VersionCheck`    | `true`  | Checks for a newer version on start, see Installation.                                          |
| `Config.Duration`        | `600`   | How long the block lasts, in seconds, counted from the moment the player is back on their feet. |
| `Config.JobDuration`     | empty   | Shorter blocks per job, see below.                                                              |
| `Config.Items.enabled`   | `false` | Items that cut the block short, see below.                                                      |
| `Config.Inventory`       | `'ox'`  | `'ox'` for ox\_inventory, `'esx'` for the native ESX inventory or anything else.                |
| `Config.Persist.enabled` | `true`  | Keeps a running block over a reconnect and a restart. Needs the SQL table, see below.           |

The duration applies to a normal respawn and to a medic revive alike. There is no separate setting for the two, because in both cases the player is standing again.

### Job durations

Jobs that get a shorter block than everyone else. The value is the block in seconds for that job, `0` means the job is never blocked. Jobs you do not list get `Config.Duration`.

```lua
Config.JobDuration = {
    ['police'] = 20,
    ['ambulance'] = 0,
    ['mechanic'] = 45
}
```

Only the job the player has at the moment of the respawn counts, and only the job name, not the grade. The table ships empty, the three lines in the file are commented out examples, so every job gets `Config.Duration` until you fill it in.

### Items that cut the block short

Off by default. To turn it on, set `enabled = true`:

```lua
Config.Items = {
    enabled = true,
    list = {
        ['bandage'] = 15,
        ['medikit'] = 30
    }
}
```

The value is the seconds one use takes off the running block. Using the item again subtracts them again, and the block ends as soon as nothing is left of it. The item is used the normal way out of the inventory and is consumed. Using it while no block runs does nothing.

With `Config.Inventory = "ox"` there is nothing to set up. The items keep whatever else they do and are consumed by ox\_inventory as usual. The only condition is that ox\_inventory treats the item as usable at all, which is the case for every normal consumable. A plain item with no use has nothing to hook into.

With `Config.Inventory = "esx"` each item is registered as a usable item, and ESX only allows one script per item. Do not list an item another script already registers, a bandage that heals for example, because it would take that script's use away. Give those servers their own item instead.

### What is blocked

```lua
Config.Block = {
    weapons = true,
    melee = true,
    shooting = true,
    aiming = true,
    vehicleWeapons = true
}
```

| Field            | What it stops                                                                                                |
| ---------------- | ------------------------------------------------------------------------------------------------------------ |
| `weapons`        | Pulling a weapon at all. The wheel and the number keys are dead and anything in the hands is put away again. |
| `melee`          | Punching and every melee attack.                                                                             |
| `shooting`       | Firing. Only matters if something slipped through, `weapons` already keeps the hands empty.                  |
| `aiming`         | Aiming. Turn this off if you only want to stop the shot, not the aim.                                        |
| `vehicleWeapons` | Vehicle weapons and drive bys.                                                                               |

### The timer

```lua
Config.Timer = {
    enabled = true,
    position = 'top-center',
    warnAt = 10
}
```

`position` is `top-center` or `bottom-center`, anything else falls back to `top-center`. The distance to the screen edge is `--timer-offset-y` in `html/style.css`. `warnAt` is the number of seconds left at which the bar turns into the warning colour. `enabled = false` runs the block silently, with nothing on screen.

### Persistence

```lua
Config.Persist = {
    enabled = true
}
```

On by default. Keeps a running block alive over a reconnect and a server restart, so quitting during the timeout no longer skips it. The block is stored per character and comes back when that character is loaded, with the seconds that really remain, not with a fresh full duration. The bypass list still applies when it comes back.

This needs the table from `sql/l_deathtimeout.sql`, see Installation. Without the table the resource prints a yellow hint on start and runs without persistence. Set `enabled = false` if you do not want it at all.

### server\_config.lua

```lua
ServerConfig.Bypass = {
    groups = {},
    jobs = {},
    ace = 'l-deathtimeout.bypass'
}
```

Everything in here is checked on the server. `groups` are ESX groups, `jobs` are jobs that are exempt, and `ace` is an ACE permission you grant in your `server.cfg`:

```
add_ace group.admin l-deathtimeout.bypass allow
```

Set `ace = false` to skip the ACE check, and leave a list empty to skip it.

```lua
ServerConfig.Logs = {
    enabled = false,
    webhook = '',
    botName = 'l-deathtimeout',
    avatar = '',
    color = 3125501
}
```

Logged is every block that starts, with the player and the duration. `color` is the embed colour as a decimal number. Keep this file server side.

### Colours

Every colour of the timer sits in `html/style.css` as a CSS variable, together with the distance to the screen edge. Edit the file, restart the resource, done.
