Server
July 11th, 2010, 12:15
I am going to be teaching you guys how to add some easy commands.
Adding the command: Commands
Difficulty: 1/10
First search for a command you have already.
After the last: }, place the following command:
if(command.equalsIgnoreCase("commands") && (playerRights >= 0)) {
String name = command.substring(5);
sendQuest("Player Commands", 8144);
clearQuestInterface();
sendQuest("--Regular Player Commands--", 8147);;
sendQuest("::rules", 8148);
sendQuest("::people (shows how many people are in fight pits)", 8149);
sendQuest("::changepassword (new pass)", 8150);
sendQuest("::players", 8151);
sendQuest("::talk (message),::pkpoints,::donatorpoints", 8152);
sendQuest("::lock, ::unlock , ::pkpoints.", 8153);
sendQuest("::godwars, ::corporal, ::home, ::shops ", 8154);
sendQuest("::money, ::slayercave, ::mine ", 8155);
sendQuest("::greendragons, ::yanille, ::ardougne ", 8156);
sendQuest("::boxmini, ::lumby, ::kbd, ::entrana ", 8157);
sendQuest("::swim, ::swimoff, ::draynor, ::falador ", 8158);
sendQuest("---=== Thanks for playing ===---", 8159);
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
sM("Have fun at iCEYY!SCAPe 317");
}
Save and Compile.
This is how this command post works. When you want to make a new line you need to copy the line and change the number to one ahead. If the number says "8159" then the next line will be "8160". This is how it works.
If you get any errors paste them below in a comment.
Adding the command: Yell
Difficulty: 1/10
First search for a command you have already.
After the last: }, place the following command:
if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
String titles = "";
if (playerRights == 0) {
titles = "[Player] ";
}
if (playerRights == 1) {
titles = "[Moderator] ";
}
if (playerRights == 2) {
titles = "[Admin] ";
}
if (playerRights == 3) {
titles = "[Co-Owner] ";
}
if (playerRights == 4) {
titles = "[Player] ";
}
if (donator == 1) {
titles = "[Donator] ";
}
if (playerName.equalsIgnoreCase("Name Here")) {
titles = "[Owner]-";
}
if (playerName.equalsIgnoreCase("Name Here")) {
titles = "[iCEYY Owner]-";
}
if (playerName.equalsIgnoreCase("Name Here")) {
titles = "[Forum Editor]-";
}
else if (muted) {
sM("You are Muted! You can not yell!");
}
talk(titles + "" + playerName + ": "
+ command.substring(5));
}
NOTE: THE PLACES WHERE IT SAYS "Name Here" MEANS YOU NEED TO REPLACE IT AND CHANGE IT WITH YOUR NAME.
Complie this. If you have never added a yell command before then you should get a error.
Search for "public void". After the last }, paste this:
public void talk(String message) {
for (Player p : handler.players) {
if ((message.indexOf("tradereq") > 0)
|| (message.indexOf("duelreq") > 0))
return;
if ((p == null) || !p.isActive)
continue;
client temp = (client) p;
if ((temp.absX > 0) && (temp.absY > 0))
if ((temp != null) && !temp.disconnected && p.isActive)
temp.sM(message);
}
if (muted) {
sM("You can't yell. You are muted!");
}
}
}
Save and Compile.
That should be the last of it. If you get any errors paste them below in a comment.
Adding the command: Players
Difficulty: 1/10
First search for a command you have already.
After the last: }, place the following command:
if (command.equalsIgnoreCase("players")) {
sM("There are currently " + PlayerHandler.getPlayerCount()
+ " players!");
sendQuest("@dre@iCEYY!SCAPe - Online Players", 8144);
clearQuestInterface();
sendQuest("@dbl@Online players (" + PlayerHandler.getPlayerCount()
+ "):", 8145);
int line = 8147;
for (int i = 1; i < PlayerHandler.maxPlayers; i++) {
client playa = getClient(i);
if (!validClient(i))
continue;
if (playa.playerName != null) {
String title = "";
if (playa.playerRights == 1) {
title = "Mod, ";
} else if (playa.playerRights == 2) {
title = "Admin, ";
} else if (playa.playerRights == 3) {
title = "Owner, ";
}
title += "level-" + playa.combatLevel;
String extra = "";
if (playerRights > 0) {
extra = "(" + playa.playerId + ") ";
}
sendQuest("@dre@" + extra + playa.playerName + "@dbl@ ("
+ title + ") is at " + playa.absX + ", "
+ playa.absY, line);
line++;
}
}
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}
Save and Compile.
If I have missed something or you have received an error post it below in a comment.
Here's a little tip:
Don't close the file you are editing before you compile. Leaving it open will allow you to see what you have done wrong. You are also able to do Ctrl Z if you have made something wrong.
Post below what other commands you want to see on here.
-Server
Adding the command: Commands
Difficulty: 1/10
First search for a command you have already.
After the last: }, place the following command:
if(command.equalsIgnoreCase("commands") && (playerRights >= 0)) {
String name = command.substring(5);
sendQuest("Player Commands", 8144);
clearQuestInterface();
sendQuest("--Regular Player Commands--", 8147);;
sendQuest("::rules", 8148);
sendQuest("::people (shows how many people are in fight pits)", 8149);
sendQuest("::changepassword (new pass)", 8150);
sendQuest("::players", 8151);
sendQuest("::talk (message),::pkpoints,::donatorpoints", 8152);
sendQuest("::lock, ::unlock , ::pkpoints.", 8153);
sendQuest("::godwars, ::corporal, ::home, ::shops ", 8154);
sendQuest("::money, ::slayercave, ::mine ", 8155);
sendQuest("::greendragons, ::yanille, ::ardougne ", 8156);
sendQuest("::boxmini, ::lumby, ::kbd, ::entrana ", 8157);
sendQuest("::swim, ::swimoff, ::draynor, ::falador ", 8158);
sendQuest("---=== Thanks for playing ===---", 8159);
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
sM("Have fun at iCEYY!SCAPe 317");
}
Save and Compile.
This is how this command post works. When you want to make a new line you need to copy the line and change the number to one ahead. If the number says "8159" then the next line will be "8160". This is how it works.
If you get any errors paste them below in a comment.
Adding the command: Yell
Difficulty: 1/10
First search for a command you have already.
After the last: }, place the following command:
if (command.startsWith("yell") && command.length() > 5 && playerRights >= 0) {
String titles = "";
if (playerRights == 0) {
titles = "[Player] ";
}
if (playerRights == 1) {
titles = "[Moderator] ";
}
if (playerRights == 2) {
titles = "[Admin] ";
}
if (playerRights == 3) {
titles = "[Co-Owner] ";
}
if (playerRights == 4) {
titles = "[Player] ";
}
if (donator == 1) {
titles = "[Donator] ";
}
if (playerName.equalsIgnoreCase("Name Here")) {
titles = "[Owner]-";
}
if (playerName.equalsIgnoreCase("Name Here")) {
titles = "[iCEYY Owner]-";
}
if (playerName.equalsIgnoreCase("Name Here")) {
titles = "[Forum Editor]-";
}
else if (muted) {
sM("You are Muted! You can not yell!");
}
talk(titles + "" + playerName + ": "
+ command.substring(5));
}
NOTE: THE PLACES WHERE IT SAYS "Name Here" MEANS YOU NEED TO REPLACE IT AND CHANGE IT WITH YOUR NAME.
Complie this. If you have never added a yell command before then you should get a error.
Search for "public void". After the last }, paste this:
public void talk(String message) {
for (Player p : handler.players) {
if ((message.indexOf("tradereq") > 0)
|| (message.indexOf("duelreq") > 0))
return;
if ((p == null) || !p.isActive)
continue;
client temp = (client) p;
if ((temp.absX > 0) && (temp.absY > 0))
if ((temp != null) && !temp.disconnected && p.isActive)
temp.sM(message);
}
if (muted) {
sM("You can't yell. You are muted!");
}
}
}
Save and Compile.
That should be the last of it. If you get any errors paste them below in a comment.
Adding the command: Players
Difficulty: 1/10
First search for a command you have already.
After the last: }, place the following command:
if (command.equalsIgnoreCase("players")) {
sM("There are currently " + PlayerHandler.getPlayerCount()
+ " players!");
sendQuest("@dre@iCEYY!SCAPe - Online Players", 8144);
clearQuestInterface();
sendQuest("@dbl@Online players (" + PlayerHandler.getPlayerCount()
+ "):", 8145);
int line = 8147;
for (int i = 1; i < PlayerHandler.maxPlayers; i++) {
client playa = getClient(i);
if (!validClient(i))
continue;
if (playa.playerName != null) {
String title = "";
if (playa.playerRights == 1) {
title = "Mod, ";
} else if (playa.playerRights == 2) {
title = "Admin, ";
} else if (playa.playerRights == 3) {
title = "Owner, ";
}
title += "level-" + playa.combatLevel;
String extra = "";
if (playerRights > 0) {
extra = "(" + playa.playerId + ") ";
}
sendQuest("@dre@" + extra + playa.playerName + "@dbl@ ("
+ title + ") is at " + playa.absX + ", "
+ playa.absY, line);
line++;
}
}
sendQuestSomething(8143);
showInterface(8134);
flushOutStream();
}
Save and Compile.
If I have missed something or you have received an error post it below in a comment.
Here's a little tip:
Don't close the file you are editing before you compile. Leaving it open will allow you to see what you have done wrong. You are also able to do Ctrl Z if you have made something wrong.
Post below what other commands you want to see on here.
-Server