Include-only dialog system for SA-MP and open.mp. Declarative, modular and easy to drop into any gamemode.
- No plugins, no dependencies — pure Pawn includes.
- Legacy compatible — keeps your old
ShowPlayerDialogdialogs working. - Named dialogs — create dialogs once, show them anywhere by slot.
- Multi-step chains —
inline-dialogs.incfor registration, surveys, wizards. - Paginated lists —
paged-dialogs.incsplits long item lists into pages. - Declarative macros —
dialog-macros.inclets you write dialogs in separate files. - Optional extras — sscanf2 helpers (
dialog-sscanf.inc) and SQLite persistence (dialog-persist.inc). - Debug logging — compile with
#define DIALOG_ENGINE_DEBUGto trace dialog lifecycle.
#define BASIC_DIALOGS_COUNT (1000)
#include "dialog-engine.inc"
#include "dialog-macros.inc"
DIALOG(WelcomeDialog)
{
g_Dlg_WelcomeDialog = DialogCreate("welcome");
DialogSetStyle(g_Dlg_WelcomeDialog, DIALOG_STYLE_MSGBOX);
DialogSetTitle(g_Dlg_WelcomeDialog, "Welcome");
DialogSetBody(g_Dlg_WelcomeDialog, "Hello! Ready to play?");
DialogSetButtons(g_Dlg_WelcomeDialog, "Yes", "No");
DialogSetHandler(g_Dlg_WelcomeDialog, "Dlg_WelcomeDialog_Response");
}
DIALOG_RESPONSE(WelcomeDialog)
{
if (!response)
{
Kick(playerid);
return 1;
}
SendClientMessage(playerid, 0x00FF00FF, "Welcome aboard!");
return 1;
}
public OnGameModeInit()
{
Dlg_Init_WelcomeDialog();
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/welcome", true))
{
SHOW_DLG(playerid,WelcomeDialog);
return 1;
}
return 0;
}- Copy the
include/folder contents into your project's include directory. - Include the modules you need.
- Define
BASIC_DIALOGS_COUNTbefore includingdialog-engine.incto reserve IDs for legacy dialogs.
#define BASIC_DIALOGS_COUNT (1000)
#include <dialog-engine> // required
#include <inline-dialogs> // optional
#include <paged-dialogs> // optional
#include <dialog-macros> // optional| File | Purpose |
|---|---|
dialog-engine.inc |
Core engine: dialog creation, dynamic IDs, handlers, timeouts, tags, bulk helpers. |
inline-dialogs.inc |
Multi-step dialog chains with automatic next/previous navigation. |
paged-dialogs.inc |
Paginated DIALOG_STYLE_LIST with built-in Next/Back items. |
dialog-macros.inc |
DIALOG() / DIALOG_RESPONSE() macros for modular single dialogs. |
dialog-sscanf.inc |
Optional sscanf2 macros and error helper. |
dialog-persist.inc |
Optional SQLite persistence for dialog state. |
examples/gamemode.pwn— minimal gamemode wiring a modular dialog.examples/dialogs/login.pwn— reusable login dialog module.tests/dialog-engine-test.pwn— full feature test suite.
qawno/pawncc.exe tests/dialog-engine-test.pwn -otests/dialog-engine-test.amx -i"qawno/include" -i"include"MIT see LICENSE.