# Warning System

**The STG Warning System adds a sleek, full-screen disciplinary overlay to your FiveM server—letting staff instantly grab a player’s attention with a bold headline, custom message, and animated timer.** While the alert is active, you can freeze movement, disable weapons, and apply temporary god-mode to keep situations under control. The script auto-detects ESX, QBCore, or standalone setups, supports full localization, logs every action for easy Discord integration, and restricts access to specified admin groups. Lightweight, plug-and-play, and completely free, it’s the smoothest way to keep order without breaking immersion.

***

## Preview Video

{% embed url="<https://youtu.be/2ksiWsk_Ru8>" %}

***

#### Features

<mark style="color:$primary;">**Full-Screen Warning Overlay**</mark>\ <mark style="color:$info;">Displays a bold title, custom message, and animated countdown that no one can miss.</mark>

<mark style="color:$primary;">**Temporary Control Locks**</mark>\ <mark style="color:$info;">Optionally freeze movement, disable weapons, and grant god-mode while the warning is active.</mark>

<mark style="color:$primary;">**Role-Based Access**</mark>\ <mark style="color:$info;">Only the staff groups you list (e.g., god, superadmin, admin) can issue warnings.</mark>

<mark style="color:$primary;">**Action Logging & Webhook-Ready**</mark>\
Every warning can be piped to Discord or any log handler for airtight moderation.

<mark style="color:$primary;">**Custom Hooks**</mark>\ <mark style="color:$info;">OnWarn and OnWarnClose callbacks let you trigger sounds, effects, or extra code when the overlay opens or closes.</mark>

<mark style="color:$primary;">**Multi-Language UI**</mark>\
Ships with EN, DE, FR, ES, and PT; easily extend or edit strings in `config.lua`.

<mark style="color:$primary;">**Configurable Timer**</mark>\ <mark style="color:$info;">Set the overlay’s auto-close duration (default 20s) to fit your server’s pace.</mark>

<mark style="color:$primary;">**Lightweight & Optimized**</mark>\ <mark style="color:$info;">Clean, efficient code ensures zero performance impact—even on busy servers.</mark>

<mark style="color:$primary;">**Completely Free**</mark>\ <mark style="color:$info;">Drop it in, ensure it, and keep your community fair without spending a cent.</mark>

***

Do you need help with the installation?

{% content-ref url="/pages/eM0KQ7ksz9oaS18MGmnm" %}
[Installation](/documentation/scripts/warning-system/installation.md)
{% endcontent-ref %}

Do you need help with the configuration?

{% content-ref url="/pages/1Tx5Jjw1VTLGHUznl41k" %}
[Configuration](/documentation/scripts/warning-system/configuration.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://stg-store.gitbook.io/documentation/scripts/warning-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
