Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define ListID 2501
- #define InputID 2502
- #define MessageID 2503
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/list", true))
- {
- ShowPlayerDialog(playerid, ListID, DIALOG_STYLE_LIST, "I'm learning the dialog list by ZiPoNz", "Send me two messages.\nGive me the weapon of this dialog.", "Select", "Cancel");
- return SendClientMessage(playerid, 0xFFFFFF00, "Please choose the option that you want to use.");
- }
- if(!strcmp(cmdtext, "/input", true))
- {
- ShowPlayerDialog(playerid, InputID, DIALOG_STYLE_INPUT, "I'm learning the dialog input by ZiPoNz", "Please write the text that you want to display for all.", "Continue", "Cancel");
- return SendClientMessage(playerid, 0xFFFFFF00, "Please write the text in the box.");
- }
- if(!strcmp(cmdtext, "/message", true))
- {
- ShowPlayerDialog(playerid, 2503, DIALOG_STYLE_MSGBOX, "Did you learn something from this guide?", "Please choose the option.", "Like", "Dislike");
- return SendClientMessage(playerid, 0xFFFFFF00, "Please choose your opinion.");
- }
- return false;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case ListID:
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0: SendClientMessage(playerid, 0xFFFFFF00, "Message number: 1."), SendClientMessage(playerid, 0xFFFFFF00, "Message number: 2.");
- case 1: GivePlayerWeapon(playerid, 24, 50);
- }
- }
- case InputID:
- {
- if(!response) return true;
- new string[128];
- format(string, 128, "%s", inputtext);
- SendClientMessageToAll(0xFFFFFF00, string);
- }
- case MessageID:
- {
- if(!response) return SendClientMessage(playerid, 0xFFFFFF00, "You chose the option: Dislike.");
- SendClientMessage(playerid, 0xFFFFFF00, "You chose the option: Like!");
- }
- }
- return true;
- }
Add Comment
Please, Sign In to add comment