Author Topic: anti lag shop  (Read 59 times)

KutiePie

  • Global Moderator
  • Junior
  • *****
  • Posts: 62
    • View Profile
anti lag shop
« on: January 14, 2011, 04:12:14 am »
      i added the part before the else
Code: [Select]
if (amount==50) {
           
                TotPrice2 = (int) Math.floor(
                        GetItemShopValue(itemID, 1, fromSlot));
                if (freeSlots() > 0) {
                    if (Item.itemIsNote[itemID] == false) {
                        deleteItem(itemID, GetItemSlot(itemID), 50);
                    } else {
                        deleteItem(itemID, fromSlot, 50);
                    }
                    addItem(995, TotPrice2*50);
                    addShopItem(itemID, 50);
                } else {
                    sendMessage("Not enough space in your inventory.");
            }
}else {

            for (int i = amount; i > 0; i--) {
                TotPrice2 = (int) Math.floor(
                        GetItemShopValue(itemID, 1, fromSlot));
                if (freeSlots() > 0) {
                    if (Item.itemIsNote[itemID] == false) {
                        deleteItem(itemID, GetItemSlot(itemID), 1);
                    } else {
                        deleteItem(itemID, fromSlot, 1);
                    }
                    addItem(995, TotPrice2);
                    addShopItem(itemID, 1);
                } else {
                    sendMessage("Not enough space in your inventory.");
                    break;
                }
            }

Share on Bluesky Share on Facebook