Procedure: Learning how to add full teleblock and copy.
Difficulty: 3.5 - May need some concentration.
Reason: To add teleblock to commands and teleport tabs.
Ever get annoyed when you teleblock someone and they just use a command like ::home, or use a tab like this:
Doing this tutorial will stop you from teleporting, like the following examples.
Now to stop them from doing this, we need to add a teleblock boolean after each case. First of all we will search case 168, because that is normally the beginning to all the other teleport cases. So open up client.java and search:
Then you should see something like this:
Code:
case 168: // bank emote
if(emotes == 0)
{
if(absY >= 3712 && absY <= 3970)
{
sendMessage("You cannot bank above Y 3712 wildy.");
}
else
{
openUpBank();
}
}
else
{
emotes = 0;
pEmote = playerSE;
updateRequired = true; appearanceUpdateRequired = true;
}
break;
We don't need to add anything to that because it is a bank emote. Now if you have a teleport tab next to it, search:
Replace the whole case with this:
Code:
case 169:
if(teleblock == true){ //Made by musicmad441
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("dummy"); //made by Musicmad441
}
break;
Simple as that, that is telling the server to make sure they aren't teleblocked before they can teleport. Now in that case, it says this:
Code:
customCommand("dummy");
That means that it will teleport you to the command :ummy. So add this with your commands:
Code:
else if (command.equalsIgnoreCase("dummy"))
{
if(teleblock == true){
sendMessage("A magical force stops you from teleporting."); //made by Musicmad441
}
else
{
teleportToX = 3253;
teleportToY = 3431;
sendMessage("Welcome to Dummy's");
}
}
Wow! as simple as that, we have now made a command disable if you are teleblocked and a tab disable if you are teleblocked!
We will now move on to a new case, just incase you are a little confused. Search in client.java:
Without teleblocked added, it will look something like this:
Code:
case 170: // laugh emote
startAnimation(1979);
break;
That it without a teleport, that is just the animation, you can tell by this bit:
Code:
startAnimation(1979);
So to make a teleport, we replace the whole case with:
Code:
case 170:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("Pkbox2");
}
break;
But remember we must add the command for it to work. So add this with your commands:
Code:
else if (command.equalsIgnoreCase("pkbox2"))
{
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
sendMessage("welcome to the pkbox 2!");
teleportToX = 2509;
teleportToY = 4729;
}
}
But remember the 2:
at the end of the command are very important or you will get errors.
Now if you need to change the name of your teleport tabs, search:
You should see something like this:
Code:
update();
sendFrame126("@whi@Bank", 180);//frist emote slot
sendFrame126("@whi@Dummys",181);
sendFrame126("@gre@Jad", 178);
sendFrame126("@whi@Mbank",175);
sendFrame126("@gre@Duela",177);
sendFrame126("@blu@PkBox",182);
sendFrame126("@gre@Admin",170);
}
Replace it all with this:
Code:
update();
sendFrame126("@red@P@blu@k@cya@b@gre@x@cya@2", 185);
sendFrame126("@cya@T@red@r@blu@a@whi@i@cya@n", 187);
sendFrame126(" @whi@ P@red@i@blu@t@cya@s", 179);
sendFrame126(" @red@K@whi@q", 173);
sendFrame126("@blu@B@whi@a@red@n@blu@k", 180);//frist emote slot
sendFrame126("@red@D@whi@u@blu@m@red@m@cya@y",181);
sendFrame126("@gre@ J@cya@a@red@d", 178);
sendFrame126("@whi@M@cya@b@blu@a@gre@n@whi@k",175);
sendFrame126("@gre@D@blu@u@whi@e@red@l@cya@a",177);
sendFrame126("@blu@P@cya@k@red@B@gre@x",182);
sendFrame126("@gre@P@blu@k@cya@b@red@x@blu@2",170);
sendFrame126(" @gre@P@cya@k",186);
}
Thankyou, hope I helped you. 100% Creds Musicmad441.
To show you what some of my cases look like, here is an example:
Code:
case 161:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("pkbox");
}
break;
case 162:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("jad");
}
break;
case 168: // bank emote
if(emotes == 0)
{
if(absY >= 3712 && absY <= 3970)
{
sendMessage("You cannot bank above Y 3712 wildy.");
}
else
{
openUpBank();
}
}
else
{
emotes = 0;
pEmote = playerSE;
updateRequired = true; appearanceUpdateRequired = true;
}
break;
case 169:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("dummy");
}
break;
case 164:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("mbank");
}
break;
case 165:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("duelarena");
}
break;
case 170:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("Pkbox2");
}
break;
case 171:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("Pk");
}
break;
case 163:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("Kq");
}
break;
case 167:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("pits");
}
break;
case 172:
if(teleblock == true){
sendMessage("A magical force stops you from teleporting.");
}
else
{
customCommand("train");
}
break;
case 166: // dance emote
startAnimation(0x362);
break;
Thankyou. rep++ would be appreciated