> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/resources/mango-achievements/configuration/integrations.md).

# Integrations

Connect your prison, police, EMS and job scripts.

Anything the server cannot see for itself comes from another resource. Every event name lives in one file, `config/integrations.lua`.

{% hint style="info" %}
Names that nothing on your server fires are simply never called, so leaving entries for resources you do not run costs nothing. Add yours to the list and it starts working — no code changes.
{% endhint %}

## Prison

```lua
prison = {
    enabled  = true,
    jailed   = { 'mango_prison:playerJailed' },
    released = { 'mango_prison:playerReleased' },
    escaped  = { 'mango_prison:playerEscaped' },
    notServed = { 'escape', 'admin', 'pardon', 'bail' },
}
```

Feeds Not Again, Hardened, Repeat Offender, Time Served and Jailbird. A release only counts as a completed sentence when its reason is not in `notServed`.

## Police

```lua
police = {
    jobs = { 'police', 'sheriff', 'state' },
    cuffEvents = {
        { event = 'esx_policejob:handcuff', net = true, toggles = true },
    },
}
```

`toggles = true` matters: many cuff events both cuff **and** uncuff. With it set, a cuffed flag is kept per target so releasing somebody does not count as a second arrest. The sender is checked for a police job before anything counts.

## Ambulance

```lua
ambulance = {
    jobs = { 'ambulance', 'ems' },
    reviveEvents = {
        { event = 'esx_ambulancejob:revive', net = true, medic = 'source', target = 'arg1' },
    },
    lateReviveSeconds = 300,
}
```

`medic` and `target` say which argument holds which player. Golden Hour uses `lateReviveSeconds`.

## Duty shifts

Timed from the job change itself, which every framework reports — so this needs no third-party events at all.

```lua
duty = { jobs = { 'ambulance', 'mechanic', 'police' }, minShiftMinutes = 10 }
```

## Everything else

Bank robberies, vehicle purchases, paychecks and job tasks follow the same pattern. Anything not listed can always be driven directly:

```lua
exports['mango_achievements']:AddStat(src, 'revives', 1)
```

See [Stats Reference](/mango5m-docs/resources/mango-achievements/developer-guide/stats-reference.md) for the full list of counters.

{% hint style="warning" %}
Some frameworks fire no event at all for certain actions — ESX has no paycheck event, for instance. Where that happens the config file says so and offers a fallback, rather than pretending it works.
{% endhint %}
