Thread: Area Recongizer

Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1 Area Recongizer 
    Registered Member Ired's Avatar
    Join Date
    May 2012
    Posts
    160
    Thanks given
    13
    Thanks received
    10
    Rep Power
    12
    Hello Rune-Server, so this shouldn't be too hard. But I've had problems with doing this because I don't know where to put the codes in at.

    Trying To Do
    -Server checks if Regular/Donators on Bridge
    -IF on Bridge, Make regular/Donators get teleported
    -Make them teleport to a certain location
    Why? Because the area i'm making is in beta testing...


    So I declared the Bridge Are in Player.java here:

    Code:
    	public boolean BridgeArea() {
    		if(absX > 2963 && absX < 2966 && absY > 3356 && absY < 3363) {	
    			return true;
    		}
    		return false;
    	}
    (Which are the right coords for the Falador Bridge)


    Now here's where I don't know where to declare this at to make them Teleport out of the area. I put mine under a Teleport void...

    Code:
    	/**
    	* Teleporting
    	**/
    	public void spellTeleport(int x, int y, int height) {
    		if (c.selectStarter == true) {
    	c.sendMessage(" You can't teleport while choosing starter!");
    	return;
    	}
    		if (c.selectStarterr == true) {
    	c.sendMessage(" You can't teleport while choosing starter!");
    	return;
    	}
    		c.getPA().startTeleport(x, y, height, c.playerMagicBook == 1 ? "ancient" : "modern");
    		c.getTradeAndDuel().declineTrade();
    	}
    	public void startMovement(int x, int y, int height) {
    		c.getPA().resetFishing();
    	//c.getMining().resetMining();
    	c.isCooking = false;
            c.usingAltar=false;
    	c.playerIsFiremaking = false;
    		if(c.duelStatus == 5) {
    			c.sendMessage("You can't teleport during a duel!");
    			return;
    		}
    		if(c.BridgeArea() && c.playerRights == 0 || c.playerRights == 4) {
    			c.getPA().movePlayer(2965, 3380, 0);
    			c.sendMessage("You cannot be on the Z Token Brige!");
    			c.sendMessage("If this becomes a problem, you will be dealt with...");
    			return;
    		}

    Any Help? I've seen this kind of on other servers where is you get into an area where your not suppose to be, you get a message saying you'll be banned the next time you do this. And the next time you do it, you get banned. Help?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Ired View Post
    Hello Rune-Server, so this shouldn't be too hard. But I've had problems with doing this because I don't know where to put the codes in at.

    Trying To Do
    -Server checks if Regular/Donators on Bridge
    -IF on Bridge, Make regular/Donators get teleported
    -Make them teleport to a certain location
    Why? Because the area i'm making is in beta testing...


    So I declared the Bridge Are in Player.java here:

    Code:
    	public boolean BridgeArea() {
    		if(absX > 2963 && absX < 2966 && absY > 3356 && absY < 3363) {	
    			return true;
    		}
    		return false;
    	}
    (Which are the right coords for the Falador Bridge)


    Now here's where I don't know where to declare this at to make them Teleport out of the area. I put mine under a Teleport void...

    Code:
    	/**
    	* Teleporting
    	**/
    	public void spellTeleport(int x, int y, int height) {
    		if (c.selectStarter == true) {
    	c.sendMessage(" You can't teleport while choosing starter!");
    	return;
    	}
    		if (c.selectStarterr == true) {
    	c.sendMessage(" You can't teleport while choosing starter!");
    	return;
    	}
    		c.getPA().startTeleport(x, y, height, c.playerMagicBook == 1 ? "ancient" : "modern");
    		c.getTradeAndDuel().declineTrade();
    	}
    	public void startMovement(int x, int y, int height) {
    		c.getPA().resetFishing();
    	//c.getMining().resetMining();
    	c.isCooking = false;
            c.usingAltar=false;
    	c.playerIsFiremaking = false;
    		if(c.duelStatus == 5) {
    			c.sendMessage("You can't teleport during a duel!");
    			return;
    		}
    		if(c.BridgeArea() && c.playerRights == 0 || c.playerRights == 4) {
    			c.getPA().movePlayer(2965, 3380, 0);
    			c.sendMessage("You cannot be on the Z Token Brige!");
    			c.sendMessage("If this becomes a problem, you will be dealt with...");
    			return;
    		}

    Any Help? I've seen this kind of on other servers where is you get into an area where your not suppose to be, you get a message saying you'll be banned the next time you do this. And the next time you do it, you get banned. Help?
    try adding it to your walking packet so say..

    if(c.inBridge) {
    c.startTeleport(xxxxxxxxxxx,yyyyyyyyy); or whatever it is
    }

    or just for donators

    if(c.inBridge) {
    if(c.isDonator) {
    c.startTeleport(xxxxxxxxxxx,yyyyyyyyyyy);
    }
    }
    Reply With Quote  
     

  3. #3  
    Registered Member Ired's Avatar
    Join Date
    May 2012
    Posts
    160
    Thanks given
    13
    Thanks received
    10
    Rep Power
    12
    Quote Originally Posted by Karma_K View Post
    try adding it to your walking packet so say..

    if(c.inBridge) {
    c.startTeleport(xxxxxxxxxxx,yyyyyyyyy); or whatever it is
    }

    or just for donators

    if(c.inBridge) {
    if(c.isDonator) {
    c.startTeleport(xxxxxxxxxxx,yyyyyyyyyyy);
    }
    }
    Would it work if I did this?

    if(c.BridgeArea() && c.playerRights == 0 || c.playerRights == 4) {
    c.startTeleport(xxxxxxxxxxx,yyyyyyyyy); or whatever it is
    }

    So it's disabled for both Donators and Players?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Ired View Post
    Would it work if I did this?

    if(c.BridgeArea() && c.playerRights == 0 || c.playerRights == 4) {
    c.startTeleport(xxxxxxxxxxx,yyyyyyyyy); or whatever it is
    }

    So it's disabled for both Donators and Players?
    oh, you want it to be disabled for them. just do something like

    if(c.inBridge) {
    if(c.playerRights == 3) {
    c.startTeleport
    }
    }

    itll only teleport owner rights.
    Reply With Quote  
     

  5. #5  
    Registered Member Ired's Avatar
    Join Date
    May 2012
    Posts
    160
    Thanks given
    13
    Thanks received
    10
    Rep Power
    12
    Quote Originally Posted by Karma_K View Post
    oh, you want it to be disabled for them. just do something like

    if(c.inBridge) {
    if(c.playerRights == 3) {
    c.startTeleport
    }
    }

    itll only teleport owner rights.
    Lol thanks, that's not what I wanted to do for owners but I got it working.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Ired View Post
    Lol thanks, that's not what I wanted to do for owners but I got it working.
    What did you want exactly, just to clarify.
    Reply With Quote  
     

  7. #7  
    Registered Member Ired's Avatar
    Join Date
    May 2012
    Posts
    160
    Thanks given
    13
    Thanks received
    10
    Rep Power
    12
    Quote Originally Posted by Karma_K View Post
    What did you want exactly, just to clarify.
    Sorry I wasn't clear, I made a new area which you can get Tokens in. It's not done yet and it's only a object blocking the way to get it. The players found a way past it, it was following me, so I disabled following in a certain area. So I don't want players with rights at 0 (normal players) or rights at 4(donators) to be able to get into the area. If they do, they get teleported out. But I got a 'beta tester' for the area that has playerRights = 0, so he's not able to help me with it. I tried adding this:

    Code:
    		if(c.BridgeArea() && c.playerRights == 0 || c.playerRights == 4) {
    			c.getPA().movePlayer(3102, 9516, 0);
    			c.Jail = true;
    			c.sendMessage("You cannot be on the Z Token Brige! Frickin' H@k0r!");
    			c.sendMessage("Please contact a staff member for help out of jail...");
    		} else if (c.playerName.equalsIgnoreCase("braeden")) {
    			c.isWalking = true;
    		}
    To make it so he's still able to walk around, but when he enters the area it still teleports him. I tried adding a else if statement above and it does't do anything except make him able to walk. Main thing I want the player with 0 rights to do is to be able to walk inside the area that I've marked "You get auto teled out of". Help? There's proabably an easy fix to be honest...
    Reply With Quote  
     

  8. #8  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Ired View Post
    Sorry I wasn't clear, I made a new area which you can get Tokens in. It's not done yet and it's only a object blocking the way to get it. The players found a way past it, it was following me, so I disabled following in a certain area. So I don't want players with rights at 0 (normal players) or rights at 4(donators) to be able to get into the area. If they do, they get teleported out. But I got a 'beta tester' for the area that has playerRights = 0, so he's not able to help me with it. I tried adding this:

    Code:
    		if(c.BridgeArea() && c.playerRights == 0 || c.playerRights == 4) {
    			c.getPA().movePlayer(3102, 9516, 0);
    			c.Jail = true;
    			c.sendMessage("You cannot be on the Z Token Brige! Frickin' H@k0r!");
    			c.sendMessage("Please contact a staff member for help out of jail...");
    		} else if (c.playerName.equalsIgnoreCase("braeden")) {
    			c.isWalking = true;
    		}
    To make it so he's still able to walk around, but when he enters the area it still teleports him. I tried adding a else if statement above and it does't do anything except make him able to walk. Main thing I want the player with 0 rights to do is to be able to walk inside the area that I've marked "You get auto teled out of". Help? There's proabably an easy fix to be honest...
    You added another if statement. Just do

    if(c.inBridge) {
    if (c.playerName.equalsIgnoreCase("braeden")) {
    return;
    } else if (c.playerRights == 0 || c.playerRights == 4) {
    c.startTeleport
    }
    }
    or use a switch statement, which I like using.

    if (c.inBridge) {
    if (c.playerName.equalsIgnoreCase("braeden")) {
    return;
    }
    switch (c.playerRights) {
    case 0:
    case 4:
    c.startTeleport
    break;
    }
    }
    Reply With Quote  
     

  9. #9  
    Registered Member Ired's Avatar
    Join Date
    May 2012
    Posts
    160
    Thanks given
    13
    Thanks received
    10
    Rep Power
    12
    Quote Originally Posted by Karma_K View Post
    You added another if statement. Just do

    if(c.inBridge) {
    if (c.playerName.equalsIgnoreCase("braeden")) {
    return;
    }
    } else if (c.playerRights == 0 || c.playerRights == 4) {
    c.startTeleport
    }
    I don't think this would work. If anyone goes inside the area EXCEPT Players with 1,2,3 rights, should be jailed (Which the teleport coords are the jail, and the c.jail = true means there jailed). I want to make it so that someone with playerRights 0 and has the name 'Braeden' can go into the area too without being jailed. Having Player Rights 0 and 4 are bad to be in the area, because that means you no clipped and get sent to jail.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Ired View Post
    I don't think this would work. If anyone goes inside the area EXCEPT Players with 1,2,3 rights, should be jailed (Which the teleport coords are the jail, and the c.jail = true means there jailed). I want to make it so that someone with playerRights 0 and has the name 'Braeden' can go into the area too without being jailed. Having Player Rights 0 and 4 are bad to be in the area, because that means you no clipped and get sent to jail.
    Then do this

    (c.inBridge) {
    if (c.playerName.equalsIgnoreCase("braeden") && c.playerRights == 0) {
    return;
    }
    switch (c.playerRights) {
    case 0:
    case 4:
    c.startTeleport
    break;
    }
    }
    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. Rikus Admin Area
    By riku9563 in forum Tutorials
    Replies: 5
    Last Post: 09-27-2007, 08:48 PM
  2. my training area
    By javva in forum Tutorials
    Replies: 4
    Last Post: 09-25-2007, 05:15 PM
  3. Make A Basic Training Area
    By Zondix in forum Tutorials
    Replies: 1
    Last Post: 09-14-2007, 12:20 PM
  4. Removing Objects In An Area (UNTESTED)
    By Llama in forum Tutorials
    Replies: 10
    Last Post: 06-21-2007, 09:33 PM
  5. Keeping stuff when you die (only in certain areas)
    By Xx nub xx in forum Tutorials
    Replies: 0
    Last Post: 05-16-2007, 05:35 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
  •