a little dialog problem
#1

Eh, code below
pawn Код:
if(dialogid == DIALOGID)
    {
        if(response)
        {
            if(listitem == 0)
            {
       ShowPlayerDialog(playerid, DIALOGARMOR, DIALOG_STYLE_LIST, "Armor", "10\n20\n30\n40\n50\n60\n70\n80\n90", "Select", "Cancel");
            }
This Code below still uses the values from the dialog "DIALOGID", so like If I go to buy armor, Instead of using the Menu For Armor, It says "You Just bought a Knife" Etc.
pawn Код:
if(dialogid == 3 )// quick find ArmorShop
    {
    if (response == 1)
    {
      switch (listitem)
      {
      case 0:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
            if(Armour > 99) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
      SetPlayerArmour(playerid,Armour+10);
      }
      case 1:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      SetPlayerArmour(playerid,Armour+20);
      if(Armour > 89) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
            }
      case 2:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 79) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
        SetPlayerArmour(playerid,Armour+30);
      }
      case 3:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 69) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
        SetPlayerArmour(playerid,Armour+40);
      }
      case 4:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 59) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
          SetPlayerArmour(playerid,Armour+50);
          }
      case 5:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 49) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
            SetPlayerArmour(playerid,Armour+60);
      }
      case 6:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 39) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
             SetPlayerArmour(playerid,Armour+70);
      }
      case 7:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 29) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
             SetPlayerArmour(playerid,Armour+80);
      }
      case 8:
      {
      new Float:Armour;
            GetPlayerArmour(playerid,Armour);
      if(Armour > 19) return SendClientMessage(playerid, COLOR_GREY, " You can't buy more then 100 Armor!");
        SetPlayerArmour(playerid,Armour+90);
      }
        }
BTW, I probibly sound like a nub, but This is the first time I've edited a Dialog :/
Reply
#2

Do not use DIALOGID, use the one you used in ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Armor", "10\n20\n30\n40\n50\n60\n70\n80\n90", "Select", "Cancel");

So:


pawn Код:
if(dialogid == 3 && response) {
//
}

Reply
#3

Quote:
Originally Posted by Jakku
Do not use DIALOGID, use the one you used in ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Armor", "10\n20\n30\n40\n50\n60\n70\n80\n90", "Select", "Cancel");

So:


pawn Код:
if(dialogid == 3 && response) {
//
}

Omg, how could i miss somthing like that? >.< I feel like an idiot now :S, ill go test it xD


EDIT: I Fixed that problem, but now The Armor shop Doesn't do anything >.<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)