if(pickupid == BuySell)ShowPlayerDialog(playerid, DIALOG_SELLBUY, DIALOG_STYLE_LIST, "Buy or sell something", "Sell\nBuy\t", "Ok", "Channel");
if(pickupid == CH) ShowPlayerDialog(playerid,DIALOG_CH,DIALOG_STYLE_LIST, "Criminal headquarter", "Enter\nBreak in\t", "Ok", "Cancel"); //sa-mp wiki fцr mer info
return 1;
if(pickupid == Infernus) ShowPlayerDialog(playerid,DIALOG_BuyCarD,DIALOG_STYLE_LIST, "Buy a Infernus for 40 000$", "Buy Infernus\t", "Ok", "Cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CH) //CH = criminal headquarter
{
if(response)
{
if(listitem == 0) // Button 1
{
SendClientMessage(playerid,Clown, "Test");
}
if(listitem == 1) //Secound item.
{
SetPlayerWantedLevel(playerid,3);
SendClientMessage(playerid,Clowns, "Test"); // Button 2
SetPlayerPos(playerid,962.2519,2394.0796,-6.4700);
return 1;
}
}
return 1;
}
if(dialogid == DIALOG_BuyCarD) //Buy car dialog
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
if(listitem == 0) // Button 1
{
GetPlayerMoney(playerid);
GivePlayerMoney(playerid,-40000);
}
if(listitem == 1) //Secound item.
{
SendClientMessage(playerid, Green, "Test");
}
return 1;
}
}
//public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
ShowPlayerDialog(playerid, DIALOG_SELLBUY, DIALOG_STYLE_LIST, "Buy or sell", "Buy weapons\nSell weapons\t", "Ok", "Cancel");
if(dialogid == DIALOG_SELLBUY)
{
if(response) // If they clicked 'Yes' or pressed enter
{
SendClientMessage(playerid, Green, "Test");
}
else // Pressed ESC or clicked cancel
{
SendClientMessage(playerid, Green, "Test");
}
return 1;
}
return 0;
}
#define DIALOG_CH 1 //Criminal head quarter
#define DIALOG_BuyCarD 2
#define DIALOG_SELLBUY 3
You are showing dialogs in OnPlayerDialogResponse at the top level - that's probably the issue.
|