Thread: funpk not teleing to start

Results 1 to 7 of 7
  1. #1 funpk not teleing to start 
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    this is my givelife method in playerassistance but when you die in funpk its not teling the player to the coords i set.
    Code:
    	public void giveLife() {
    		c.isDead = false;
    		c.faceUpdate(-1);
    		c.freezeTimer = 0;
    		if(c.duelStatus <= 4 && !c.getPA().isOwner() && !c.getPA().isAdmin()) { // if we are not in a duel we must be in wildy so remove items
    				if (!CastleWars.isInCw(c) && !c.inPits() && !c.inFightCaves() && !c.inFunPk() && !c.getPA().isOwner() && !c.getPA().isAdmin()) {
    					c.getItems().resetKeepItems();
    				if((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 2) {
    					if(!c.isSkulled) {	// what items to keep
    						c.getItems().keepItem(0, true);
    						c.getItems().keepItem(1, true);	
    						c.getItems().keepItem(2, true);
    					}
    					if(c.prayerActive[10] && System.currentTimeMillis() - c.lastProtItem > 700) {
    						c.getItems().keepItem(3, true);
    					}
                                            c.getItems().dropAllItemsPVP();
    					if(c.trade11 < 1 && !c.inRFD() && !c.isInFala() && !c.isInArd()) {
    					c.getItems().dropAllItems(); // drop all items
    					c.getItems().deleteAllItems(); // delete all items
    				        }
    				        if(c.inRFD()) {
    					c.getItems().deleteAllItems(); // delete all items
    				        }
    					c.getPA().ResetGWKC();
    
    					
    					if(!c.isSkulled) { // add the kept items once we finish deleting and dropping them	
    						for (int i1 = 0; i1 < 3; i1++) {
    							if(c.itemKeptId[i1] > 0) {
    								c.getItems().addItem(c.itemKeptId[i1], 1);
    							}
    						}
    					}	
    					if(c.prayerActive[10]) { // if we have protect items 
    						if(c.itemKeptId[3] > 0) {
    							c.getItems().addItem(c.itemKeptId[3], 1);
    						}
    					}
    				}
    				c.getItems().resetKeepItems();
    			} else if (c.inPits) {
    				Server.fightPits.removePlayerFromPits(c.playerId);
    				c.pitsStatus = 1;
    			} 
    		}
    		c.getCombat().resetPrayers();
    		for (int i = 0; i < 20; i++) {
    			c.playerLevel[i] = getLevelForXP(c.playerXP[i]);
    			c.getPA().refreshSkill(i);
    		}
    if (c.pitsStatus == 1) {
    			movePlayer(2399, 5173, 0);
    		}
    if (c.inFunPk) {
    			movePlayer(2605, 3153, 0);
    		}
    else if (CastleWars.isInCw(c)) {
                if (CastleWars.getTeamNumber(c) == 1) {
                    c.getPA().movePlayer(2426 + Misc.random(3), 3076 - Misc.random(3), 1);
                } else {
                    c.getPA().movePlayer(2373 + Misc.random(3), 3131 - Misc.random(3), 1);
                }
    		} else if(c.duelStatus <= 4) { // if we are not in a duel repawn to wildy
    movePlayer(c.SETHOMEX, c.SETHOMEY, 0);
    c.isSkulled = false;
    c.skullTimer = 0;
    c.attackedPlayers.clear();
    		} else if (c.inFightCaves()) {
    			c.getPA().resetTzhaar();
    		} else if (c.inRFD()) {
    			c.getPA().resetRFD();
    		} else { // we are in a duel, respawn outside of arena
    			Client o = (Client) Server.playerHandler.players[c.duelingWith];
    			if(o != null) {
    				o.getPA().createPlayerHints(10, -1);
    				if(o.duelStatus == 6) {
    					o.getTradeAndDuel().duelVictory();
    					//o.pcPoints += 1;
    					//o.sendMessage("You have gained 1 Soul Split Points for winning a duel");
    				}
    			}
    			movePlayer(Config.DUELING_RESPAWN_X+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), Config.DUELING_RESPAWN_Y+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);
    			if(c.duelStatus != 6) { // if we have won but have died, don't reset the duel status.
    				c.getTradeAndDuel().resetDuel();
    			}
    		}
    the red is what i added
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Dec 2011
    Posts
    33
    Thanks given
    0
    Thanks received
    3
    Rep Power
    11
    Would you please post the inFunPk boolean so I can take a look at that?

    Is it handled via location or is it set upon teleport or what?
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    ^ why would you need to take a look at it?you would just put if (c.inFunPk()) c.getPA().movePlayer(####, ####, #);
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2011
    Posts
    33
    Thanks given
    0
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by relex lawl View Post
    ^ why would you need to take a look at it?you would just put if (c.inFunPk()) c.getPA().movePlayer(####, ####, #);
    when you die in funpk its not teling the player to the coords i set.
    Which leads me to believe the boolean could be returning false and that could be his problem.
    Reply With Quote  
     

  5. #5  
    Chow down on these noodles
    OodlesOfNoodles's Avatar
    Join Date
    May 2011
    Posts
    1,819
    Thanks given
    235
    Thanks received
    91
    Rep Power
    55
    you mean this right?
    public boolean inFunPk() {
    if(absX > 2582 && absX < 2602 && absY > 3152 && absY < 3171 ||
    absX > 2601 && absX < 2607 && absY > 3156 && absY < 3171){
    return true;
    }
    return false;
    }
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Dec 2011
    Posts
    33
    Thanks given
    0
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by Pastaway View Post
    you mean this right?
    Replace your code with this:
    Code:
    public void giveLife() {
    		c.isDead = false;
    		c.faceUpdate(-1);
    		c.freezeTimer = 0;
    		if(c.duelStatus <= 4 && !c.getPA().isOwner() && !c.getPA().isAdmin()) { // if we are not in a duel we must be in wildy so remove items
    				if (!CastleWars.isInCw(c) && !c.inPits() && !c.inFightCaves() && !c.inFunPk() && !c.getPA().isOwner() && !c.getPA().isAdmin()) {
    					c.getItems().resetKeepItems();
    				if((c.playerRights == 2 && Config.ADMIN_DROP_ITEMS) || c.playerRights != 2) {
    					if(!c.isSkulled) {	// what items to keep
    						c.getItems().keepItem(0, true);
    						c.getItems().keepItem(1, true);	
    						c.getItems().keepItem(2, true);
    					}
    					if(c.prayerActive[10] && System.currentTimeMillis() - c.lastProtItem > 700) {
    						c.getItems().keepItem(3, true);
    					}
                                            c.getItems().dropAllItemsPVP();
    					if(c.trade11 < 1 && !c.inRFD() && !c.isInFala() && !c.isInArd()) {
    					c.getItems().dropAllItems(); // drop all items
    					c.getItems().deleteAllItems(); // delete all items
    				        }
    				        if(c.inRFD()) {
    					c.getItems().deleteAllItems(); // delete all items
    				        }
    					c.getPA().ResetGWKC();
    
    					
    					if(!c.isSkulled) { // add the kept items once we finish deleting and dropping them	
    						for (int i1 = 0; i1 < 3; i1++) {
    							if(c.itemKeptId[i1] > 0) {
    								c.getItems().addItem(c.itemKeptId[i1], 1);
    							}
    						}
    					}	
    					if(c.prayerActive[10]) { // if we have protect items 
    						if(c.itemKeptId[3] > 0) {
    							c.getItems().addItem(c.itemKeptId[3], 1);
    						}
    					}
    				}
    				c.getItems().resetKeepItems();
    			} else if (c.inPits) {
    				Server.fightPits.removePlayerFromPits(c.playerId);
    				c.pitsStatus = 1;
    			} 
    		}
    		c.getCombat().resetPrayers();
    		for (int i = 0; i < 20; i++) {
    			c.playerLevel[i] = getLevelForXP(c.playerXP[i]);
    			c.getPA().refreshSkill(i);
    		}
    if (c.pitsStatus == 1) {
    			movePlayer(2399, 5173, 0);
    		}
    if (c.inFunPk()) {
    			movePlayer(2605, 3153, 0);
    		}
    else if (CastleWars.isInCw(c)) {
                if (CastleWars.getTeamNumber(c) == 1) {
                    c.getPA().movePlayer(2426 + Misc.random(3), 3076 - Misc.random(3), 1);
                } else {
                    c.getPA().movePlayer(2373 + Misc.random(3), 3131 - Misc.random(3), 1);
                }
    		} else if(c.duelStatus <= 4) { // if we are not in a duel repawn to wildy
    movePlayer(c.SETHOMEX, c.SETHOMEY, 0);
    c.isSkulled = false;
    c.skullTimer = 0;
    c.attackedPlayers.clear();
    		} else if (c.inFightCaves()) {
    			c.getPA().resetTzhaar();
    		} else if (c.inRFD()) {
    			c.getPA().resetRFD();
    		} else { // we are in a duel, respawn outside of arena
    			Client o = (Client) Server.playerHandler.players[c.duelingWith];
    			if(o != null) {
    				o.getPA().createPlayerHints(10, -1);
    				if(o.duelStatus == 6) {
    					o.getTradeAndDuel().duelVictory();
    					//o.pcPoints += 1;
    					//o.sendMessage("You have gained 1 Soul Split Points for winning a duel");
    				}
    			}
    			movePlayer(Config.DUELING_RESPAWN_X+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), Config.DUELING_RESPAWN_Y+(Misc.random(Config.RANDOM_DUELING_RESPAWN)), 0);
    			if(c.duelStatus != 6) { // if we have won but have died, don't reset the duel status.
    				c.getTradeAndDuel().resetDuel();
    			}
    		}
    inFunPk was a method not a variable, therefore it needed "()" at the end of it.
    Simple mistake.
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Quote Originally Posted by Zalestro View Post
    Which leads me to believe the boolean could be returning false and that could be his problem.
    ah k didnt read the whole thing...
    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. Npc teleing.. -.-
    By Ryan™ in forum Help
    Replies: 3
    Last Post: 05-11-2010, 02:54 AM
  2. Teleing rep+
    By Arvid in forum Help
    Replies: 0
    Last Post: 04-25-2009, 09:42 AM
  3. Warning before teleing
    By Warnerr in forum Help
    Replies: 2
    Last Post: 03-18-2009, 04:43 PM
  4. Teleing
    By Sir Lethal in forum Help
    Replies: 2
    Last Post: 01-25-2009, 09:16 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
  •