05.05.2012, 16:02
How to create a dialog like , lets say Someone did /guide he chosen an option from one dialog and after he chooses that option another dialog shows?
// Add this one just below the #include <a_samp> and other .inc files.
#define NEWDIALOG 150
//Add this dialog line in your command /guide.
ShowPlayerDialog(playerid,NEWDIALOG,DIALOG_STYLE_LIST,"Guide","1. Line\r\n2. Line\r\n3. Line","Okay", "Close");
//Use this under OnDialogResponse callback
switch( dialogid )
{
case NEWDIALOG:
{
if(!response) return ShowPlayerDialog(playerid,SECONDDIALOG,DIALOG_STYLE_LIST,"Second Guide Line","1. Line\r\n2. Line\r\n3. Line","Okay", "Close");
if(listitem == 0)
{
// Your Code here.
}
if(listitem == 1)
{
// Your Code here.
}
if(listitem == 2)
{
// Your Code here.
}
}
case SECONDDIALOG:
{
// Then add your codes here like the above dialog or the way you want.
}
}
#define GUIDES 5006
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:guides(playerid, params[])
{
ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_LIST, "Server Guides", "Guides1 \nGuides2\nGuides3", "Select", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == GUIDES)// /changes
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_MSGBOX/List, "Title","Text", "Ok", "Cancel");//Change the "Title" and "Text" if you want
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_MSGBOX/List, "title","Text", "Ok", "Cancel");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, GUIDES, DIALOG_STYLE_MSGBOX/List, "title","Text", "Ok", "Cancel");
}
}
return 1;
}
Its something like this.
pawn Код:
|