Loop through all items in the players inventory then check if player has ess if so delete item and add the appropriate rune and amount.
|
Im not actually adding RC to my server (infact im not even working on one) but i was wondering how you would make it so that it deletes all the ess in your inventory?
rep++ for answer
Loop through all items in the players inventory then check if player has ess if so delete item and add the appropriate rune and amount.
That will loop from 0 - the ammount of items in the players inv be it 1 or 27 .length finds that for you. if it finds an itemID (ess) it will deleteItem and it will then addItem the rune. But obviously that doesn't support multiple rune crafting and whatever.Code:for(int i =0; i <c.playerItems.length; i++) { if(c.getItems().playerHasItem(itemID)) { c.getItems().deleteItem(itemID, amount); c.getItems().addItem(itemID, amount); } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |