> 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/developer-guide/stats-reference.md).

# Stats Reference

Every counter you can drive, and where it comes from.

A **stat** is a shared counter. Several awards can hang off one, which is how tiers advance together.

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

## Counted automatically

| Stat                                             | Source                         |
| ------------------------------------------------ | ------------------------------ |
| `session_start`                                  | Every character load           |
| `first_join`                                     | First ever load                |
| `daily_login`                                    | Once per calendar day          |
| `playtime_minutes`                               | Server-side clock              |
| `money_earned` / `money_spent`                   | Balance sampling               |
| `downed`                                         | Framework death events         |
| `vehicles_owned`                                 | Your framework's vehicle table |
| `locations_found`                                | Landmark detection             |
| `distance_driven`                                | Client, server-validated       |
| `crimes` / `session_crimes`                      | Client, server-validated       |
| `top_speed_300` / `deep_dive` / `chiliad_summit` | Client, server-validated       |
| `players_met`                                    | Client, server-validated       |
| `completionist`                                  | Evaluated on every unlock      |

## From your integrations

| Stat                                                         | Fired by                 |
| ------------------------------------------------------------ | ------------------------ |
| `prison_sentences` / `sentence_completed` / `prison_escapes` | Your prison resource     |
| `arrests` / `police_duty`                                    | Your police job          |
| `revives` / `late_revive`                                    | Your ambulance job       |
| `bank_robberies` / `clean_getaways`                          | Your bank robbery script |
| `shifts`                                                     | Duty tracking            |
| `paychecks`                                                  | Your framework           |
| `job_tasks`                                                  | Your job scripts         |

## Yours to define

Any name you like. Put it on an award and call `AddStat` with it:

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

{% hint style="info" %}
Calling `AddStat` with a name no award uses is harmless — it is logged when `Config.Debug` is on and otherwise ignored, so you can add the calls before the awards exist.
{% endhint %}
