Thread: [PI] PvP

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 [PI] PvP 
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Hello i added pvp in my pi server the interfaces skulls etc work the lvls but when i try to attack a player thats not possible so i realy gotta know how to fix it i tryed to slove it myself first and try using search bar but no result

    so please help me fix this

    thanks anyway
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2008
    Posts
    58
    Thanks given
    0
    Thanks received
    0
    Rep Power
    20
    Wait... What?
    Start again. So you've got the interfaces etc working, but you cannot attack a player when you should be able to. Are you in a zone you haven't marked as a Wilderness Zone yet or are you in the parameters of the original 'inWild' boolean?
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    i mean i added it everything but drops but when i try to attack an player it says that player is not in wildy
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2008
    Posts
    58
    Thanks given
    0
    Thanks received
    0
    Rep Power
    20
    Ok. So at what location are you trying to attack this player?
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    lumby falador and ardy

    Code:
    	public boolean isInPVP() {		
    		if(absX >= 3194 && absX <= 3251 && absY >= 3190 && absY <= 3288) {
    			return true;
    		}
    		return false;
    	}
    	public boolean isInArd() {
    		if(absX > 2583 && absX < 2729 && absY > 3255 && absY < 3343) {	
    			return true;
    		}
    		return false;
    	}
    	public boolean isInFala() {
    		if(absX > 2941 && absX < 3060 && absY > 3314 && absY < 3399) {	
    			return true;
    		}
    		return false;
    	}
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2008
    Posts
    58
    Thanks given
    0
    Thanks received
    0
    Rep Power
    20
    Ok. It seems you have not added those booleans to the player combat methods.

    Firstly, I will simplify all of those three PvP booleans into one.

    Code:
    	public boolean isInPVP() {		
    		if((absX >= 3194 && absX <= 3251 && absY >= 3190 && absY <= 3288) 
    		|| (absX > 2583 && absX < 2729 && absY > 3255 && absY < 3343)
    		|| (absX > 2941 && absX < 3060 && absY > 3314 && absY < 3399)) {
    			return true;
    		}
    		return false;
    	}
    Go to combatAssistant.java, and search for the line
    Code:
    		if(!Server.playerHandler.players[c.playerIndex].inWild()) {
    And replace it with
    Code:
    		if(!Server.playerHandler.players[c.playerIndex].inWild() && !Server.playerHandler.players[c.playerIndex].isInPVP()) {
    Then 13 lines under that is
    Code:
    		if(!c.inWild()) {
    Replace that with
    Code:
    		if(!c.inWild() && !c.isInPVP()) {
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    ya but with that safe zones dont work? and if i add my safe zones then i cant attack in normal places again

    Edit: stuff worked above here but then my safe zones dont work
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Nov 2008
    Posts
    58
    Thanks given
    0
    Thanks received
    0
    Rep Power
    20
    Are ardougne and falador your safezones?
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Code:
    	public boolean safeZone() {
    		if(absX > 2943 && absX < 2949 && absY > 3358 && absY < 3374 || absX > 3009 && absX < 3018 && absY > 3355 && absY < 3359 || absX > 2612 && absX < 2622 && absY > 3330 && absY < 3335 || absX > 2648 && absX < 2658 && absY > 3279 && absY < 3287)		 {	
    			return true;
    		}
    		return false;
    	}
    
    	public boolean isInPVPSafe() {		
    		if(absX >= 3200 && absX <= 3230 && absY >= 3200 && absY <= 3234) {
    			return true;
    		}
    		return false;
    	}
    dont put them together my falador and ardy are diffrent then lumby about stuff and drops etc
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Nov 2008
    Posts
    58
    Thanks given
    0
    Thanks received
    0
    Rep Power
    20
    Ok. So basically just refer to the places where I told you to edit those few lines, and edit them where necessary to include your new areas and safezones.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •