22.07.2011, 10:34
Here's an example:
in /duty command
pawn Код:
#define DIALOG_DUTY 10
#define DIALOG_CLOTHES 11
pawn Код:
ShowDialog(playerid, dialogid)
{
switch(dialogid)
{
case DIALOG_DUTY:
{
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Duty", "Duty\nClothes\nWeapons\nUndercover", "Select", "Cancel");
}
case DIALOG_CLOTHES:
{
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Clothes", "Nice Clothes\nGood Clothes\nAwesome Clothes", "Select", "Cancel");
}
}
}
pawn Код:
ShowDialog(playerid, DIALOG_DUTY);
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_DUTY)
{
if(response)
{
switch(listitem)
{
case 0: // when player chooses "Duty"
case 1: ShowDialog(playerid, DIALOG_CLOTHES);
case 2: // when player chooses "Weapons"
case 3: // when player chooses "Undercover"
}
}
return 1;
}
if(dialogid == DIALOG_CLOTHES)
{
if(response)
{
switch(listitem)
{
case 0: // when player chooses "Nice Clothes"
case 1: // when player chooses "Good Clothes"
case 2: // when player chooses "Awesome Clothes"
}
}
return 1;
}
return 1;
}