Check DropItem.java [Server Sided], if you don't get it just add the ::empty command pretty easy.
|
how can you make it so a certain rights drops items and it just disapears, and they can't trade?
Check DropItem.java [Server Sided], if you don't get it just add the ::empty command pretty easy.
search in your "PlayerAssistant.java" applyDead and giveLife methods for
c.getItems().deleteAllItems();
also try commenting out or removing in "DropItem.java"
c.getItems().deleteItem(itemId, slot, c.playerItemsN[slot]);
Next go to "Commands.java"
add this under any bracket that ends a commandif (playerCommand.equalsIgnoreCase("empty")) {
c.getPA().removeAllItems();
}
There you go, items aren't drop-able, only able to ::empty all items...
Create an array with the undroppable/ untradable items, when they're dropped use the deleteItem(-arrayname/element here-)
Might need to create another method.
Sorry I explained wrong, I want it so character rights 5, when it drops items itjust dissapears ithout going on the floor, and disable there trade
To disable drops for character rights 5 go to dropitem.java and look for (should be near or at end of file):
right above it addCode:Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId());
and under it addCode:if (c.playerRights != 5) {
so it looks like :Code:}
This will make it so the player wont even be able to drop. It just wont work. Nothing will disappear (i like this better because the disappearing one is little harsh )Code:if (c.playerRights != 2) { Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId()); }
To disable trade open up tradeandduel.java and look for :
under it add:Code:public void requestTrade(int id){
Code:if (c.playerRights == 5) { c.sendMessage("You're not allowed to trade."); return; }
I want it to dissapear because sometimes they miss-spell what they wanna spawn thne there stuck with a bad item
and they gotta bank everything just to empty it which gets annoying
This into playerassistantDropitem.javaCode:public void destroyItem(int itemId) { itemId = c.droppedItem; String itemName = c.getItems().getItemName(itemId); c.getItems().deleteItem(itemId,c.getItems().getItemSlot(itemId), c.playerItemsN[c.getItems().getItemSlot(itemId)]); c.sendMessage("Your " + itemName + " vanishes as you drop it on the ground."); removeAllWindows(); }is the code needed to destroy it, so replace..Code:c.getPA().destroyItem(itemId);with the aboveCode:c.getPA().dropItem(itemId);
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |