Ok so basically what happens is this:
Say I want to buy an item that is 5 points,
If you have 5 or more points, the item is never bought but the points are deducted.
If you have less then 5 points, the item is bought and the points are deducted, it also includes the else statement ("You don't have enough points")
Any ideas?
ShopAssistant Code:
Code:
if(c.myShopId == 65) {
if (c.Points >= TotPrice2) {
if (c.getItems().freeSlots() > 0) {
c.Points -= TotPrice2;
c.getItems().addItem(itemID, 1);
Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
}
} else {
c.sendMessage("You don't have enough space in your inventory.");
break;
}
} else {
c.sendMessage("You don't have enough Points.");
break;
}
}