Thread: Dropped Items on Death

Results 1 to 10 of 10
  1. #1 Dropped Items on Death 
    Registered Member
    Join Date
    Aug 2013
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    So right now i have a bug where if a player dies at slayer tower and they teleport back there and run up, their items wont be there.. so i just thought i'd make it so when players die outside of the wildy, they keep their items. i was told it was in my playerassistant.java and that i change something to this to fix it right here
    Code:
    	public void giveLife() {
    		c.isDead = false;
    		c.faceUpdate(-1);
    		c.freezeTimer = 0;
    		if (!Dueling.isDueling(c) && !c.getPA().inPitsWait() && !c.inZombiesGame() && !c.inFightPits() && !c.inFightCaves() && !c.inBarbDef) {
    			if (c.playerRights < 6) { 
    				if (!c.inSoulWarsGame()) {
    					if (!c.isSkulled) {
    						for (int i = 0; i < 3; i++)
    							c.getItems().keepItem(i, true);
    					}
    					if ((c.prayerActive[10] || c.curseActive[0]) && System.currentTimeMillis() - c.lastProtItem > 700) {
    						c.getItems().keepItem(3, true);
    					}
    					c.getItems().dropAllItems();
    					c.getItems().deleteAllItems();
    					if (!c.isSkulled) {
    						for (int i1 = 0; i1 < 3; i1++) {
    							if (c.itemKeptId[i1] > 0) {
    								c.getItems().addItem(c.itemKeptId[i1], 1);
    							}
    						}
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    How about you try it first and then we help?

    tip something with !c.isInWilderness or w/e PI uses

    What are your Owner and Admin rights btw?

    Code:
     if (c.playerRights < 6) { 
    				if (!c.inSoulWarsGame()) {
    					if (!c.isSkulled) {
    						for (int i = 0; i < 3; i++)
    							c.getItems().keepItem(i, true);
    					}
    					if ((c.prayerActive[10] || c.curseActive[0]) && System.currentTimeMillis() - c.lastProtItem > 700) {
    						c.getItems().keepItem(3, true);
    					}
    					c.getItems().dropAllItems();
    					c.getItems().deleteAllItems();
    					if (!c.isSkulled) {
    						for (int i1 = 0; i1 < 3; i1++) {
    							if (c.itemKeptId[i1] > 0) {
    								c.getItems().addItem(c.itemKeptId[i1], 1);
    							}
    						}
    looks weird
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2013
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Luzoxpk View Post
    How about you try it first and then we help?
    try what?
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by T Raww View Post
    try what?
    if (!Dueling.isDueling(c) && !c.getPA().inPitsWait() && !c.inZombiesGame() && !c.inFightPits() && !c.inFightCaves() && !c.inBarbDef && !c.isInWilderness) {

    Something like this perhaps ^
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2013
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Luzoxpk View Post
    if (!Dueling.isDueling(c) && !c.getPA().inPitsWait() && !c.inZombiesGame() && !c.inFightPits() && !c.inFightCaves() && !c.inBarbDef && !c.isInWilderness) {

    Something like this perhaps ^
    that made it backwards, so now wild is a safe zone and everywhere else players lose items. thanks btw
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Dec 2013
    Posts
    47
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Code:
    public void giveLife()
    
    {
    		c.isDead = false;
    		c.faceUpdate(-1);
    		c.freezeTimer = 0;
    
    if (c.playerRights < 6)
    
    {
    
    if (!c.isInWilderness)
    
    {
    
    if (!c.isSkulled) 
    
    {
    
    if ((c.prayerActive[10] || c.curseActive[0]) && System.currentTimeMillis() - c.lastProtItem > 1000) 
    
    {
    
    c.getItems().keepItem(0, true);
    
    }
    
    else
    
    {
    
    i = 0;
    
    }
    
    else
    
    if ((c.prayerActive[10] || c.curseActive[0]) && System.currentTimeMillis() - c.lastProtItem > 1000) 
    
    {
    
    for (int i = 0, i < 4, i++)
    c.getItems().keepItem(i, true);
    
    }
    
    else
    
    {
    
    for (int i = 0, i < 3, i++)
    c.getItems().keepItem(i, true);
    
    }
    
    if (i > 0)
    
    {
    
    c.getItems().dropAllItems();
    c.getItems().addItem(c.itemKeptId[i], 1);
    
    }
    }
    
    else
    
    {
    
    c.getItems().keepAllItems();
    
    //I AM NOT SURE IF THE ABOVE LINE EXISTS AS A METHOD.
    
    }
    
    }
    }
    }
    Don't know if this will work or not. This is what I think it will do.

    Basically, if the player is lower than permission level 6 then it will check if they are in the wilderness. If they are, and if they are skulled, it will check if their protection prayer was on. If it was on, then it will protect 1 item otherwise it will drop all items. If they aren't skulled, it will check if their protection prayers are on and if one is then it will protect four items and if it is not, it will protect three items. At the end it will clear all items regardless of what it was and add in the items at the very end.
    Reply With Quote  
     

  7. #7  
    Registered Member Pseudo's Avatar
    Join Date
    Jan 2014
    Posts
    227
    Thanks given
    31
    Thanks received
    43
    Rep Power
    37
    if (c.playerRights < 6 || !c.isInWilderness) {
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Aug 2013
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Pseudo_ View Post
    if (c.playerRights < 6 || !c.isInWilderness) {
    where in there would i add that
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Dec 2013
    Posts
    47
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Pseudo_ View Post
    if (c.playerRights < 6 || !c.isInWilderness) {
    That should be &&, not ||. If it's || then it goes everywhere for players under rank 6 which isn't wanted in this case.
    Reply With Quote  
     

  10. #10  
    Registered Member Pseudo's Avatar
    Join Date
    Jan 2014
    Posts
    227
    Thanks given
    31
    Thanks received
    43
    Rep Power
    37
    Quote Originally Posted by fattomax View Post
    That should be &&, not ||. If it's || then it goes everywhere for players under rank 6 which isn't wanted in this case.
    Well spotted.
    Reply With Quote  
     


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. [508] Espeon drop items on death
    By Xeris in forum Help
    Replies: 3
    Last Post: 06-26-2011, 02:25 AM
  2. Drop items on death REP++!
    By Dem0n in forum Help
    Replies: 3
    Last Post: 09-16-2010, 10:05 PM
  3. drop items on death
    By E C T A S Y in forum Help
    Replies: 0
    Last Post: 04-17-2010, 03:41 PM
  4. [REQ] Dropping items on death
    By Chrham_2 in forum Help
    Replies: 5
    Last Post: 03-29-2010, 06:44 PM
  5. [525] Dropped Items On Death [525]
    By Mr NYC in forum Help
    Replies: 8
    Last Post: 06-08-2009, 02:08 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •