Thread: PI Disabling trade and drop

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 PI Disabling trade and drop 
    Donator
    Ashley's Avatar
    Join Date
    Oct 2011
    Age
    29
    Posts
    411
    Thanks given
    175
    Thanks received
    70
    Rep Power
    67
    how can you make it so a certain rights drops items and it just disapears, and they can't trade?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Return's Avatar
    Join Date
    Dec 2011
    Posts
    348
    Thanks given
    2
    Thanks received
    19
    Rep Power
    145
    Check DropItem.java [Server Sided], if you don't get it just add the ::empty command pretty easy.
    http://www.rune-server.org/static/signaturepic/sigpic181420_6.gif

    last activity 11/10/2015 Wow! Everyone has to start somewhere., right? : )
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2011
    Posts
    142
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    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"

    if (playerCommand.equalsIgnoreCase("empty")) {
    c.getPA().removeAllItems();
    }
    add this under any bracket that ends a command

    There you go, items aren't drop-able, only able to ::empty all items...
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2011
    Posts
    279
    Thanks given
    5
    Thanks received
    20
    Rep Power
    3
    Create an array with the undroppable/ untradable items, when they're dropped use the deleteItem(-arrayname/element here-)
    Might need to create another method.
    Reply With Quote  
     

  5. #5  
    Donator
    Ashley's Avatar
    Join Date
    Oct 2011
    Age
    29
    Posts
    411
    Thanks given
    175
    Thanks received
    70
    Rep Power
    67
    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
    Reply With Quote  
     

  6. #6  
    Get On My Level

    ItsGoml's Avatar
    Join Date
    Dec 2010
    Posts
    643
    Thanks given
    11
    Thanks received
    79
    Rep Power
    391
    To disable drops for character rights 5 go to dropitem.java and look for (should be near or at end of file):

    Code:
    Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId());
    right above it add
    Code:
    if (c.playerRights != 5) {
    and under it add
    Code:
    }
    so it looks like :

    Code:
    	if (c.playerRights != 2) {
    Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId());
    }
    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 )
    Spoiler for My Vouches:

    Quote Originally Posted by Randon View Post
    huge vouch for this guy! 100% legit
    Quote Originally Posted by xGenesis R View Post
    Friendly bump + vouch, reliable.



    Reply With Quote  
     

  7. #7  
    Get On My Level

    ItsGoml's Avatar
    Join Date
    Dec 2010
    Posts
    643
    Thanks given
    11
    Thanks received
    79
    Rep Power
    391
    To disable trade open up tradeandduel.java and look for :

    Code:
    public void requestTrade(int id){
    under it add:

    Code:
    			if (c.playerRights == 5) 
    			{
    				c.sendMessage("You're not allowed to trade.");
    				return;
    			}
    Spoiler for My Vouches:

    Quote Originally Posted by Randon View Post
    huge vouch for this guy! 100% legit
    Quote Originally Posted by xGenesis R View Post
    Friendly bump + vouch, reliable.



    Reply With Quote  
     

  8. #8  
    Donator
    Ashley's Avatar
    Join Date
    Oct 2011
    Age
    29
    Posts
    411
    Thanks given
    175
    Thanks received
    70
    Rep Power
    67
    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
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    This into playerassistant
    Code:
    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();
    	}
    Dropitem.java
    Code:
    c.getPA().destroyItem(itemId);
    is the code needed to destroy it, so replace..
    Code:
    c.getPA().dropItem(itemId);
    with the above
    "Know thy self, know thy enemy. A thousand battles, a thousand victories." - Sun Tzu
    GitHub: https://github.com/Faris-Mckay
    Reply With Quote  
     

  10. #10  
    Get On My Level

    ItsGoml's Avatar
    Join Date
    Dec 2010
    Posts
    643
    Thanks given
    11
    Thanks received
    79
    Rep Power
    391
    Quote Originally Posted by Faris View Post
    This into playerassistant
    Code:
    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();
    	}
    Dropitem.java
    Code:
    c.getPA().destroyItem(itemId);
    is the code needed to destroy it, so replace..
    Code:
    c.getPA().dropItem(itemId);
    with the above
    Why get so complicated? Just put this:

    Code:
    if (c.playerRights == 5) {
    c.getItems().deleteItem(itemId, slot, c.playerItemsN[slot]);
    }
    above
    Code:
    Server.itemHandler.createGroundItem(c, itemId, c.getX(), c.getY(), c.playerItemsN[slot], c.getId());
    Spoiler for My Vouches:

    Quote Originally Posted by Randon View Post
    huge vouch for this guy! 100% legit
    Quote Originally Posted by xGenesis R View Post
    Friendly bump + vouch, reliable.



    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Need help with trade/drop
    By Dem0n in forum Help
    Replies: 19
    Last Post: 09-07-2010, 07:56 PM
  2. [PI] Drop in Trade
    By HiImRusty in forum Help
    Replies: 3
    Last Post: 07-18-2010, 07:07 AM
  3. Disabling drop in trade [pi]
    By Haskell Curry in forum Help
    Replies: 4
    Last Post: 06-30-2010, 04:25 PM
  4. Insanity disabling trade in wilderness
    By LegionX in forum Requests
    Replies: 10
    Last Post: 05-28-2010, 11:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •