27.11.2016, 10:49
(
Последний раз редактировалось ZiGGi; 25.11.2017 в 13:55.
)
mdialog
AboutModern dialog system.
Functions
Open dialog
PHP код:
Dialog_Open(playerid, function[], style, caption[], info[], button1[], button2[]);
PHP код:
Dialog_Close(playerid);
PHP код:
Dialog_IsOpen(playerid);
PHP код:
Dialog_Show(playerid, function[]);
PHP код:
Dialog_Message(playerid, caption[], info[], button1[]);
PHP код:
Dialog_MessageEx(playerid, response[], caption[], info[], button1[], button2[]);
If MDIALOG_ZLANG_MODE is defined then some mdialog functions take a new view.
Open dialog
PHP код:
Dialog_Open(playerid, function[], style, caption[], info[], button1[], button2[], {Float, _}:...);
PHP код:
Dialog_Message(playerid, caption[], info[], button1[], {Float, _}:...);
PHP код:
Dialog_MessageEx(playerid, response[], caption[], info[], button1[], button2[], {Float, _}:...);
You can use tags for markup your dialogs:
Tag | Description |
\\c | Centers the text |
\\r | Aligns the text to the right |
Usage
You can use DialogCreate: and DialogResponse: prefixes:
PHP код:
DialogCreate:test(playerid)
{
Dialog_Open(playerid, Dialog:test, DIALOG_STYLE_MSGBOX,
"Hello",
"Are you ok?",
"Yes", "No");
}
DialogResponse:test(playerid, response, listitem, inputtext[])
{
if (!response) {
SendClientMessage(playerid, -1, "This club only for OK guys!");
Dialog_Show(playerid, Dialog:test);
return 1;
}
SendClientMessage(playerid, -1, "Welcome to the club");
return 1;
}
PHP код:
#define MDIALOG_ZLANG_MODE
#include "mdialog"
DialogCreate:test(playerid)
{
Dialog_Open(playerid, Dialog:test, DIALOG_STYLE_MSGBOX,
"Hello",
"LANG_ARE_YOU_OK",
"Yes", "BUTTON_NO",
playerid);
}
DialogResponse:test(playerid, response, listitem, inputtext[])
{
if (!response) {
SendClientMessage(playerid, -1, "This club only for OK guys!");
Dialog_Show(playerid, Dialog:test);
return 1;
}
SendClientMessage(playerid, -1, "Welcome to the club");
return 1;
}
PHP код:
LANG_ARE_YOU_OK = Hey id %d, are you ok?
BUTTON_NO = No
- GitHub download page: https://github.com/Open-GTO/mdialog/releases