Thread: Can't Attack Players In PvP Area [Rep/Thank]

Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1 Can't Attack Players In PvP Area [Rep/Thank] 
    Registered Member
    iHybrid's Avatar
    Join Date
    Sep 2010
    Posts
    2,096
    Thanks given
    636
    Thanks received
    352
    Rep Power
    81
    Everything else in the tutorial works besides the most important part, attacking other players lol.

    Note: You can still attack players in the wilderness, idk if that's relevant.

    Tutorial: [Only registered and activated users can see links. ]

    Client Class: [Only registered and activated users can see links. ]

    I think it has to do with this:

    Spoiler for Process Method:

    Code:
    		if (BountyHunter.safeArea(this)) {
    			headIconPk = -1;
    			getPA().requestUpdates();
    		}
    		if (inWild() && !BountyHunter.inBH(this)) {
    			int modY = absY > 6400 ? absY - 6400 : absY;
    			wildLevel = (((modY - 3520) / 8) + 1);
    			getPA().walkableInterface(197);
    			getPA().sendFrame126("@[email protected]: " + wildLevel, 199);
    			getPA().sendFrame126("Level: " + wildLevel, 25352);
    			getPA().showOption(3, 0, "Attack", 1);
    			
    		} else if (FistOfGuthix.inFoGHall(this)) {
    			if (FistOfGuthix.hasForbiddedItem(this)) {
    				getPA().walkableInterface(11607);
    				getPA().sendFrame126("@[email protected] following item is not allowed in the arena:", 11609);
    				getPA().sendFrame126("@[email protected]" + forbiddenItem, 11610);
    			} else {
    				getPA().walkableInterface(11694);
    				getPA().sendFrame126("Rating: " + fogRating, 11696);
    			}
    			/**
    			 * PvP Zone Safe Timer
    			 */
    			
    		} else if (!inPvP() && safeTimer > 0) {
    			wildLevel = 12;
    			getPA().walkableInterface(21400);
    			getPA().sendFrame126("" + safeTimer, 21403);
    			pvpHandler.pvpLevels();
    		} else if (inPvP()) {
    			wildLevel = 12;
    			getPA().walkableInterface(21300);
    			pvpHandler.pvpLevels();
    			getPA().showOption(3, 0, "Attack", 1);
    		} else if (inSafeZone()) {
    			getPA().walkableInterface(21200);
    			pvpHandler.pvpLevels();
    			
    			/**
    			 * End PvP Zone Safe Timer
    			 */

    Rep/Thanks to anyone that helps

    EDIT:
    Quote Originally Posted by gomomo11 View Post
    Process has nothing to do with your problem. The process is only used to show the"Attack" option whenever you're in pvp area.

    Your problem is in the combatassistant class.
    Yeah your right, because when I commented out the showFrame Attack thing I didn't have the option to attack anymore. So the code is definitely being read.

    Here's my CombatAssistant class and the code I've added to it.

    CombatAssistant Class: [Only registered and activated users can see links. ]

    Code added:
    Code:
    		/**
    		 * PvP Zone
    		 */
    		if(!PlayerHandler.players[c.playerIndex].inPvP() && PlayerHandler.players[c.playerIndex].safeTimer <= 0) {
    			c.sendMessage("@[email protected] player is not in PvP.");
    			c.stopMovement();
    			c.getCombat().resetPlayerAttack();
    			return false;
    		}
    		if(c.inSafeZone() && c.safeTimer <= 0) {
    			c.sendMessage("@[email protected] are not in PvP.");
    			c.stopMovement();
    			c.getCombat().resetPlayerAttack();
    			return false;
    		}
    Reply With Quote  
     

  2. #2  
    Registered Member blastashes's Avatar
    Join Date
    Apr 2012
    Age
    26
    Posts
    175
    Thanks given
    3
    Thanks received
    4
    Rep Power
    17
    maybe follow a funpk tutourial and make the pvp zones wilderness or multi?

    or just say f*** it and make custom pvp zones in the wilderness with barrier objects and custom objects detailing the area.

    because when you instance "inSafeZone or inPVP" your just basically copying isInWild or inWild. which is pointless because inWild can be used multiple times over and over again.

    If none of this makes sense.

    Make a 2nd world for your server, call it a pvp world, and make the whole place a wild zone.

    And instance banks or the g.e(if you have 508 maps) as safezones. or not in wild
    Reply With Quote  
     

  3. #3  
    Registered Member
    iHybrid's Avatar
    Join Date
    Sep 2010
    Posts
    2,096
    Thanks given
    636
    Thanks received
    352
    Rep Power
    81
    Quote Originally Posted by blastashes View Post
    maybe follow a funpk tutourial and make the pvp zones wilderness or multi?

    or just say f*** it and make custom pvp zones in the wilderness with barrier objects and custom objects detailing the area.

    because when you instance "inSafeZone or inPVP" your just basically copying isInWild or inWild. which is pointless because inWild can be used multiple times over and over again.

    If none of this makes sense.

    Make a 2nd world for your server, call it a pvp world, and make the whole place a wild zone.

    And instance banks or the g.e(if you have 508 maps) as safezones. or not in wild
    Thanks But I'd rather use this system. Not really interested in giving up yet and turning to alternatives.
    Reply With Quote  
     

  4. #4  
    Registered Member
    gomomo11's Avatar
    Join Date
    May 2010
    Posts
    2,383
    Thanks given
    268
    Thanks received
    196
    Rep Power
    177
    Process has nothing to do with your problem. The process is only used to show the"Attack" option whenever you're in pvp area.

    Your problem is in the combatassistant class.

    no external links without affiliate
    Reply With Quote  
     

  5. #5  
    Registered Member blastashes's Avatar
    Join Date
    Apr 2012
    Age
    26
    Posts
    175
    Thanks given
    3
    Thanks received
    4
    Rep Power
    17
    Np, i get what you mean, alternatives are what everyone does and what your doing is...
    Well, i guess you could say different. but goodluck.
    Reply With Quote  
     

  6. #6  
    Registered Member
    iHybrid's Avatar
    Join Date
    Sep 2010
    Posts
    2,096
    Thanks given
    636
    Thanks received
    352
    Rep Power
    81
    Quote Originally Posted by gomomo11 View Post
    Process has nothing to do with your problem. The process is only used to show the"Attack" option whenever you're in pvp area.

    Your problem is in the combatassistant class.
    Yeah your right, because when I commented out the showFrame Attack thing I didn't have the option to attack anymore. So the code is definitely being read.

    Here's my CombatAssistant class and the code I've added to it.

    CombatAssistant Class: [Only registered and activated users can see links. ]

    Code added:
    Code:
    		/**
    		 * PvP Zone
    		 */
    		if(!PlayerHandler.players[c.playerIndex].inPvP() && PlayerHandler.players[c.playerIndex].safeTimer <= 0) {
    			c.sendMessage("@[email protected] player is not in PvP.");
    			c.stopMovement();
    			c.getCombat().resetPlayerAttack();
    			return false;
    		}
    		if(c.inSafeZone() && c.safeTimer <= 0) {
    			c.sendMessage("@[email protected] are not in PvP.");
    			c.stopMovement();
    			c.getCombat().resetPlayerAttack();
    			return false;
    		}
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2011
    Posts
    230
    Thanks given
    2
    Thanks received
    22
    Discord
    View profile
    Rep Power
    45
    make sure that is under the method public void attackplayer,

    check for any other ifs like thers probly one checking that player isnt in wild adn then returning because of that.. does it say this player is not in the wilderness when you try to attack?
    Reply With Quote  
     

  8. #8  
    Registered Member
    iHybrid's Avatar
    Join Date
    Sep 2010
    Posts
    2,096
    Thanks given
    636
    Thanks received
    352
    Rep Power
    81
    Quote Originally Posted by Divine-pkers View Post
    make sure that is under the method public void attackplayer,

    check for any other ifs like thers probly one checking that player isnt in wild adn then returning because of that.. does it say this player is not in the wilderness when you try to attack?
    No, it doesn't send either message

    Code:
    c.sendMessage("@[email protected] player is not in PvP.");
    Code:
    c.sendMessage("@[email protected] are not in PvP.");
    But that is probably because I am in PvP, I just can't attack other players.

    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,830
    Thanks given
    893
    Thanks received
    1,439
    Discord
    View profile
    Rep Power
    2924
    so when you try to attack someone, what DOES happen?
    "Know thy self, know thy enemy. A thousand battles, a thousand victories." - Sun Tzu
    GitHub: [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. #10  
    Registered Member
    iHybrid's Avatar
    Join Date
    Sep 2010
    Posts
    2,096
    Thanks given
    636
    Thanks received
    352
    Rep Power
    81
    Quote Originally Posted by Faris View Post
    so when you try to attack someone, what DOES happen?
    Nothing at all. The characters won't even face each other when I click attack.

    Is it possibly something to do with the attackPlayer method?
    Reply With Quote  
     

Page 1 of 3 123 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. Replies: 2
    Last Post: 04-03-2012, 08:58 AM
  2. Replies: 1
    Last Post: 02-18-2010, 07:42 AM
  3. Players within an area? I will REP++ for help =]
    By lkc cheat service in forum Help
    Replies: 3
    Last Post: 01-21-2010, 01:30 AM
  4. Replies: 15
    Last Post: 01-13-2010, 02:57 AM
  5. cant attack players in pvp please help!!
    By Samdude151 in forum Help
    Replies: 4
    Last Post: 12-24-2009, 10:18 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
  •