Thread: How to make player can't teleport from jailed

Results 1 to 5 of 5
  1. #1 How to make player can't teleport from jailed 
    Founder of PKEmine
    Sqay.'s Avatar
    Join Date
    Jan 2016
    Posts
    188
    Thanks given
    107
    Thanks received
    27
    Rep Power
    0
    so guys i'm try make a jailed in a new place but i can't make player can't teleport from this place


    it is new place




    and that is mypos to place

    3229/3503/0


    and this is code isInJail

    Code:
    public boolean isInJail() {		
    		if(absX >= 2065 && absX <= 2111 && absY >= 4415 && absY <= 4455) {
    			return true;
    		}
    		return false;
    	}
    jail command

    Code:
    if (playerCommand.startsWith("jail")) {
    			try {
    				String[] playerToBan = playerCommand.split(" ", 2);
    				for (int i = 0; i < Config.MAX_PLAYERS; i++) {
    					if (PlayerHandler.players[i] != null) {
    						if (PlayerHandler.players[i].playerName
    								.equalsIgnoreCase(playerToBan[1])) {
    							Client c2 = (Client) PlayerHandler.players[i];
    							if (c2.duelStatus == 5) {
    								c.sendMessage("You cant jail a player when he is during a duel.");
    								return;
    							}
    							c2.teleportToX = 3228;
    							c2.teleportToY = 3501;
    							c2.sendMessage("You have been jailed by "
    									+ c.playerName + " .");
    							c.sendMessage("Successfully Jailed "
    									+ c2.playerName + ".");
    						}
    					}
    				}
    			} catch (Exception e) {
    				c.sendMessage("Player Must Be Offline.");
    			}
    		}
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Oct 2014
    Posts
    146
    Thanks given
    5
    Thanks received
    18
    Rep Power
    4
    Go to Playerassistant.java, find the method:
    Code:
    public void startTeleport(int x, int y, int height, String teleportType) {
    and add in this directly in the method, under the first curly brace would do fine.:

    Code:
    if(c.isInJail()) {
    			c.sendMessage("You cannot teleport out of jail.");
    			return;
    		}
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    RSPS SERVICES PROVIDER

    The Plateau's Avatar
    Join Date
    May 2015
    Posts
    999
    Thanks given
    592
    Thanks received
    191
    Rep Power
    129
    Quote Originally Posted by Unlike Me View Post
    Go to Playerassistant.java, find the method:
    Code:
    public void startTeleport(int x, int y, int height, String teleportType) {
    and add in this directly in the method, under the first curly brace would do fine.:

    Code:
    if(c.isInJail()) {
    			c.sendMessage("You cannot teleport out of jail.");
    			return;
    		}
    is don't mean it i think
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Founder of PKEmine
    Sqay.'s Avatar
    Join Date
    Jan 2016
    Posts
    188
    Thanks given
    107
    Thanks received
    27
    Rep Power
    0
    Quote Originally Posted by Sky O.o View Post
    is don't mean it i think
    Alright all i need is to fix this part

    Code:
    public boolean isInJail() {		
    		if(absX >= 2065 && absX <= 2111 && absY >= 4415 && absY <= 4455) {
    			return true;
    		}
    		return false;
    	}
    also this is mypos

    3229/3503/0
    Reply With Quote  
     

  7. #5  
    Registered Member
    _Ali's Avatar
    Join Date
    Apr 2014
    Posts
    382
    Thanks given
    67
    Thanks received
    147
    Rep Power
    252
    Go to bottom left corner of the jail, write down the coord x and coord y. Then go to top right corner of the jail, write down the coord x and coord y. Example: Firstcoords: 3200, 3480 Secondcoords: 3249, 3530.

    Code:
    public boolean isInJail() {		
    	if (absX >= 3200 && absX <= 3249 && absY >=  3480 && absY <= 3530) {
    	    return true;
    	}
        return false;
    }
    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. Replies: 2
    Last Post: 09-21-2010, 06:58 AM
  2. Replies: 1
    Last Post: 07-02-2010, 10:28 PM
  3. Replies: 1
    Last Post: 04-30-2009, 10:48 PM
  4. How to make " Players Online " in quest list
    By Cizentia in forum Tutorials
    Replies: 32
    Last Post: 03-15-2009, 05:35 PM
  5. Replies: 11
    Last Post: 11-02-2008, 09:53 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
  •