03.03.2014, 01:06
Hello. I'm creating a dialog (which i havent done for a while.) and upon pressing "Close" it prompts me to the skin selection menu. How can I make it close the dialog instead of showing the skin dialog? Thank you.
pawn Код:
switch (dialogid)
{
case SHOP_DIALOG:
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, SHOP_SKIN, DIALOG_STYLE_INPUT, "Enter a valid Skin ID.", "Enter Skin ID", "OK", "Cancel");
}
if(listitem == 1) //armour
{
SetPlayerArmour(playerid, 50);
GivePlayerMoney(playerid, -2500);
}
}
case SHOP_SKIN:
{
if (response)
{
SetPlayerSkin(playerid, strval(inputtext));
GivePlayerMoney(playerid, -5000);
}
return 1;
}
pawn Код:
CMD:shop(playerid, params[])
{
new money = GetPlayerMoney(playerid);
if(GameProgress == 1) return SendClientMessage(playerid,COLOR_GREY, "Error: You can't open the shop when a game is in progress.");
if(intro[playerid] == 1) return SendClientMessage(playerid,COLOR_GREY, "Error: You can't open the shop in the introduction.");
if(money < 5000 ) return SendClientMessage(playerid,COLOR_GREY, "Error: You need at least 5,000 to open the shop.");
{
ShowPlayerDialog(playerid,SHOP_DIALOG,DIALOG_STYLE_LIST,"Hunger Games Shop", "Buy different skin (5,000$)\nArmour(2,500$)", "Select", "Cancel");
}
return 1;
}