Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

LiveDialogs.inc

LiveDialogs

ID
d6ouivnilegovhg7ca10
author
vawylon's avatar

vawylon

@vawylon


View profile
Copy link
  Report member
started
Dec 19, 2025
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Libraries
LiveDialogs.inc
vawylon's avatar

vawylon

@vawylon


View profile
Copy link
  Report member
• 3mo
Libraries

LiveDialogs.inc

library

LiveDialogs

https://github.com/vawylon/LiveDialogs

LiveDialogs — Allows you to write multi-level dialogs in a single function without duplicating logic between “opening” and “handling the response”.

Example:

```c
CMD:menu(playerid) {
    Dialog_Create(playerid, Dialog:Menu);
}

dialog Menu(playerid)
{
    Create:<"Money">
    {
        // when pressing "Back" we will close the dialog
        ResponseRight: return DIALOG_CLOSE;

        // using a loop we create 10 items
        for (new i = 1, amount; i <= 10; i++) {
            new amount = i * 20000;
            ListItem:<"Get %d$", amount>
            {
                GivePlayerMoney(playerid, amount);
                SendClientMessage(playerid, -1, "You received {44FF44}%d$", amount);
                return DIALOG_REOPEN; // Reopen the dialog
            }
        }

        ListItem:<"Experience">
        {
            // Dialog when selecting the "Experience" item
            Create:<"Get experience">
            {
                // Go back in case "Back" is pressed
                ResponseRight: return DIALOG_BACK;

                ListItem:<"1 EXP">
                {
                    SetPlayerLevel(playerid, GetPlayerLevel(playerid) + 1);
                    SendClientMessage(playerid, -1, "You received {FFCC44}%d EXP", 1);
                    return DIALOG_BACK;
                }

                ListItem:<"Enter value">
                {
                    // Create a dialog when selecting value input
                    Create:<"Get experience">
                    {
                        // Go back in case "Back" is pressed
                        ResponseRight: return DIALOG_BACK;

                        InputText:<"Enter amount of experience">
                        {
                            new exp = Dialog_Number(playerid);
                            if (exp <= 0)
                            {
                                // Reopen the dialog if the number is not valid
                                SendClientMessage(playerid, -1, "Invalid value entered!");
                                return DIALOG_REOPEN;
                            }

                            SetPlayerLevel(playerid, GetPlayerLevel(playerid) + exp);
                            SendClientMessage(playerid, -1, "You received {FFCC44}%d EXP", exp);

                            return DIALOG_BACK;
                        }
                    }
                    Button:<"Give", "Back">;
                }
            }
            Button:<"Select", "Back">;
        }
    }
    Button:<"Select", "Close">;
}
```

0 likes0 replies

    Please sign up or log in to reply