|
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:
(Which are the right coords for the Falador Bridge)Code:public boolean BridgeArea() { if(absX > 2963 && absX < 2966 && absY > 3356 && absY < 3363) { return true; } return false; }
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?
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:
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...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; }
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;
}
}
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.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |