<!-- fivemad.com, Markdown source of https://fivemad.com/docs/tools/warning-buttons -->
> Source: https://fivemad.com/docs/tools/warning-buttons
> Section: Tools
> Tags: warning screen, SetWarningMessage, alert, buttons, flags
> Tool: https://fivemad.com/tools/warning-buttons
> Last updated: 2026-09-25
> Site map for assistants: https://fivemad.com/llms.txt

# Warning Screen Buttons

Pick the buttons for a GTA V alert screen, get the flag value for SetWarningMessageWithHeader, preview it and copy a Lua snippet that reads the input.

Warning Screen Buttons calculates the button flags for the full-screen GTA V alert (the black "Alert" screen with Yes / No at the bottom). You pick the buttons, see a preview with your own text, and copy a Lua snippet that draws the screen and waits for the player's choice.

Every snippet block on this page has a **Lua / JS / TS / C#** switcher in its corner. The choice is remembered across the site, and [the runtimes page](/docs/development/runtimes) explains what changes between them.

## What it is for

`SetWarningMessage` and `SetWarningMessageWithHeader` take a bit field that decides which instructional buttons appear on the screen. Each bit adds one button: Yes is 4, No is 32, so Yes / No is `36`. Useful for "are you sure" prompts: leaving a job, deleting a character, confirming a purchase.

## Quick start

1. Pick a **Preset** (the page opens on **Yes / No**, `36`) or toggle buttons.
2. Fill **Header**, **Line 1** and **Line 2** in the **Text** panel and check the **Preview**.
3. Turn **Black background** on or off.
4. Copy `warning.lua`.

**Decode a value** in the **Button flags** panel reads `36`, `0x24` or `4 | 32` and shows which buttons it contains.

## Button flags

| Bit | Value | Name | Text | Key |
| --- | --- | --- | --- | --- |
| 0 | 1 | SELECT | Select | Enter |
| 1 | 2 | OK | OK | Enter |
| 2 | 4 | YES | Yes | Enter |
| 3 | 8 | BACK | Back | Esc |
| 4 | 16 | CANCEL | Cancel | Esc |
| 5 | 32 | NO | No | Esc |
| 6 | 64 | RETRY | Retry | Space |
| 7 | 128 | RESTART | Restart | Space |
| 8 | 256 | SKIP | Skip | Space |
| 9 | 512 | QUIT | Quit | Esc |
| 10 | 1024 | ADJUST | Adjust | Left / right arrows |
| 11 | 2048 | SPACE_NO_TEXT | (no text) | Space |
| 12 | 4096 | SHARE | Share | Space |
| 13 | 8192 | SIGN_IN | Sign In | Space |
| 14 | 16384 | CONTINUE | Continue | Enter |
| 15 | 32768 | ADJUST_ARROWS | Adjust | Left / right symbols |
| 16 | 65536 | SCROLL | Scroll | Up / down symbols |
| 17 | 131072 | OVERWRITE | Overwrite | Space |
| 18 | 262144 | SOCIAL_CLUB_SIGN_UP | Social Club Sign Up | Enter |
| 19 | 524288 | CONFIRM | Confirm | Enter |
| 20 | 1048576 | QUEUE | Queue | Enter |
| 21 | 2097152 | RETRY_ACCEPT | Retry | Enter |
| 22 | 4194304 | BACK_ESC | Back | Esc |
| 23 | 8388608 | SOCIAL_CLUB | Social Club | Enter |
| 24 | 16777216 | SPECTATE | Spectate | Space |
| 25 | 33554432 | OK_CANCEL_KEY | OK | Esc |
| 26 | 67108864 | CANCEL_TRANSFER | Cancel Transfer | Esc |
| 27 | 134217728 | LOADING_SPINNER | (spinner) | none |
| 28 | 268435456 | NO_RETURN_TO_GTA | No - Return to Grand Theft Auto V | Esc |
| 29 | 536870912 | CANCEL_ESC | Cancel | Esc |

The constant names are descriptive labels used by this tool. The game has no official names for most of these bits.

## Presets

| Preset | Value |
| --- | --- |
| OK | 2 |
| Yes / No | 36 |
| OK / Cancel | 18 |
| Confirm / Back | 524296 |
| Retry / Cancel | 80 |
| Continue | 16384 |
| Back / Continue | 16392 |
| Skip / OK | 258 |
| Loading spinner | 134217728 |
| Cancel + spinner | 134217744 |

## The generated snippet

The snippet registers your text with `AddTextEntry` (warning screens only take text entry keys, not raw strings), then draws the screen every frame until a key is pressed. Buttons are grouped by what they mean, and each group is checked with frontend controls in input group 2, which still work while the warning is up:

| Group | Controls checked |
| --- | --- |
| accept | 201, 217 (`INPUT_FRONTEND_ACCEPT`, `INPUT_FRONTEND_SELECT`) |
| cancel | 202 (`INPUT_FRONTEND_CANCEL`) |
| alt | 203 (`INPUT_FRONTEND_X`) |
| adjust | 189, 190 (`INPUT_FRONTEND_LEFT`, `INPUT_FRONTEND_RIGHT`) |
| scroll | 188, 187 (`INPUT_FRONTEND_UP`, `INPUT_FRONTEND_DOWN`) |

For Yes / No it looks like this:

```lua title="warning.lua"
local WARNING_FLAGS = 36 -- YES | NO

AddTextEntry("FM_WARN_HEADER", "Alert")
AddTextEntry("FM_WARN_LINE1", "Are you sure you want to leave the server?")
AddTextEntry("FM_WARN_LINE2", "Unsaved progress will be lost.")

local function ShowWarning()
    while true do
        SetWarningMessageWithHeader("FM_WARN_HEADER", "FM_WARN_LINE1", WARNING_FLAGS, "FM_WARN_LINE2", false, -1, true, 0, true)
        if IsControlJustPressed(2, 201) or IsControlJustPressed(2, 217) then return "accept" end
        if IsControlJustPressed(2, 202) then return "cancel" end
        Wait(0)
    end
end

CreateThread(function()
    local choice = ShowWarning()
    if choice == "accept" then
        print("Accepted")
    elseif choice == "cancel" then
        print("Cancelled")
    end
end)
```

If only the loading spinner (or nothing) is selected, there is nothing to press, so the snippet shows the screen for 5 seconds instead.

## Tips

> [!IMPORTANT]
> The buttons are only visual. The game does not report which one was pressed, you check the keys yourself, like the snippet does.

- The warning has to be drawn every frame, inside a loop with `Wait(0)`.
- Several bits share a key. Select, OK, Yes and Continue are all Enter, so combining two of them gives the player two labels for the same key.
- **Black background** is passed as the background argument of `SetWarningMessageWithHeader`.

## Limitations

The preview is an approximation of the game's layout, not a screenshot. Everything runs in the browser.

## Related tools

- [Controls Reference](/docs/tools/controls-reference)
- [Draw Text Colors](/docs/tools/text-colors)
- [Scaleform Functions](/docs/tools/scaleform-reference)
- [Driving Style Calculator](/docs/tools/driving-style-calculator)
