> For the complete documentation index, see [llms.txt](https://docs.fivemstats.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fivemstats.net/panel/settings.md).

# Settings

Connection, secret key and every setting of the game script.

Only the server's owner sees this page.

## Connection

Name, **Server IP or hostname**, **Game port** and **Secret key**. Changes are only saved after a successful connection test.

## Secret key

**Generate a key** makes a strong `tgiann_stats_secret_key` and puts it in the form. Then:

1. Copy the lines into `server.cfg`.
2. Restart your server.
3. Hit **Save changes**.

## Game script

The game script's own settings. They are stored on your game server (`tgiann-media/settings.json`), so the server must be online to change them. **Save changes** applies them at once, no restart.

### Data retention

Older records are deleted once a day. **Forever** keeps everything.

| Setting              | Default |
| -------------------- | ------- |
| Player positions     | 30 days |
| Online player counts | 30 days |
| Kills                | Forever |
| Money transactions   | Forever |
| Sessions             | Forever |
| Disconnects          | Forever |
| Chat messages        | 30 days |

Days can be 1 to 3650.

### Players and items

| Setting                | Default                               | What it does                                                                                       |
| ---------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **AFK after**          | 5 minutes (1 to 120)                  | A player who does not move or talk this long counts as AFK                                         |
| **Player screenshots** | 6 per minute (0 to 60)                | Screenshots one player may start per minute with the client `TakeImage` export. `0` turns them off |
| **Screenshot timeout** | 15 seconds (1 to 60)                  | How long a server screenshot waits for the player's game                                           |
| **Ignored items**      | Clothing items (`c_mask`, `c_bag`...) | Left out of item statistics and owners. Applies on the next hourly scan. Up to 500 names           |

For script developers: [Screenshots and Uploads](https://docs.fivemstats.net/tgiann-fivem-stats-script/for-developers/screenshots-and-uploads.md).

### Logs

What the script writes to the log service, which dataset it goes to, and how long lines are kept.

| Setting                         | Default           | What it does                                                                 |
| ------------------------------- | ----------------- | ---------------------------------------------------------------------------- |
| **Lowest level kept**           | `info`            | Lower levels from every script are dropped                                   |
| **Print to the server console** | Off               | Every log line also shows in the FXServer console                            |
| **Delete old logs**             | Forever           | Log lines of every dataset older than this many days (1 to 3650) are deleted |
| **Player joins and leaves**     | On, `connections` |                                                                              |
| **Chat messages**               | Off, `chat`       | High volume on busy servers                                                  |
| **Resource starts and stops**   | On, `resources`   |                                                                              |
| **txAdmin actions**             | On, `txadmin`     | Kicks, warns, bans, announcements, restarts                                  |

{% hint style="danger" %}
With **Delete old logs** set, every log line older than that many days is deleted for good when you save, then once a day. This cannot be undone.
{% endhint %}

To delete old lines once instead, use **Delete old logs** on the [Server Logs](https://docs.fivemstats.net/panel/server-logs.md#delete-old-logs) page. If the row is missing, update the game script ([Updating from an Older Version](https://docs.fivemstats.net/tgiann-fivem-stats-script/updating-from-an-older-version.md)).

Dataset names use letters, digits, `_`, `-` and `.`. Writing your own logs: [Log API](https://docs.fivemstats.net/tgiann-fivem-stats-script/for-developers/log-api.md).

### Media storage

Old files are deleted once a day. Files marked **Keep forever** on the [Media](https://docs.fivemstats.net/panel/media.md) page are never removed.

| Setting                                           | Default | What it does                                                                                           |
| ------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| **Images**, **Videos**, **Audio**, **JSON files** | Forever | Days a file of that type is kept (1 to 3650)                                                           |
| **Image quality**                                 | 85%     | WebP quality for converted images. Lower saves disk space. Images already in WebP are kept as they are |
| **Public address**                                | Empty   | The address in file links. Empty uses the server's IP (with HTTPS when it is on)                       |

Set **Public address** when files are served through a domain or a reverse proxy, for example `https://media.yourserver.com`, without a `/` at the end. New links use it at once. The easiest way to get a domain with HTTPS: [Cloudflare Tunnel](https://docs.fivemstats.net/tgiann-fivem-stats-script/https/cloudflare-tunnel.md). Your own proxy or certificate: [HTTPS](https://docs.fivemstats.net/tgiann-fivem-stats-script/https.md#reverse-proxy-or-domain).

## Remove server

Removes the server from the panel. Members lose access immediately. Nothing on the game server is deleted, and you can add the server again later.
