PDA

View Full Version : [317] Basic 317 Guide (Adding yell, commands, players, and taking player's requests)



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

Break
July 11th, 2010, 12:18
Good job, Had all those commands tho.

-V.
July 11th, 2010, 12:19
if (playerName.equalsIgnoreCase("server")) {
titles = "[Owner]-";
}
if (playerName.equalsIgnoreCase("icedice")) {
titles = "[iCEYY Owner]-";
}
if (playerName.equalsIgnoreCase("heroxsword")) {
titles = "[Forum Editor]-";
}
if (playerName.equalsIgnoreCase("jari")) {
titles = "[Co & Coder]-";
}

Seriously? You want newbies to copy and paste that code in so you get an epic title when you login their server -___-"?

Server
July 11th, 2010, 12:45
if (playerName.equalsIgnoreCase("server")) {
titles = "[Owner]-";
}
if (playerName.equalsIgnoreCase("icedice")) {
titles = "[iCEYY Owner]-";
}
if (playerName.equalsIgnoreCase("heroxsword")) {
titles = "[Forum Editor]-";
}
if (playerName.equalsIgnoreCase("jari")) {
titles = "[Co & Coder]-";
}

Seriously? You want newbies to copy and paste that code in so you get an epic title when you login their server -___-"?

Whoops forgot to edit that. Thanks.

Break
July 11th, 2010, 12:47
if (playerName.equalsIgnoreCase("server")) {
titles = "[Owner]-";
}
if (playerName.equalsIgnoreCase("icedice")) {
titles = "[iCEYY Owner]-";
}
if (playerName.equalsIgnoreCase("heroxsword")) {
titles = "[Forum Editor]-";
}
if (playerName.equalsIgnoreCase("jari")) {
titles = "[Co & Coder]-";
}

Seriously? You want newbies to copy and paste that code in so you get an epic title when you login their server -___-"?

L0l, You do reliease every fail coder can edit the names.

Sunni
July 11th, 2010, 12:49
Nice topic, but most server now a days are coming with these commands and I already had them.

Server
July 11th, 2010, 13:04
These days you will see a lot of newbies asking for these simple commands. This is the guide for them.

RaNsOm X
July 11th, 2010, 16:59
GREAT TUT mate, I think i might even use some of these :P

Aaron
July 11th, 2010, 17:29
Nice Tutorial for this stuff:D

Server
July 14th, 2010, 01:01
Thanks. If anyone else has another other suggestion please post below.

Charlie`
July 14th, 2010, 01:06
nice tut very helpful for plain servers.

Server
September 27th, 2010, 11:09
That's what I am hoping. Anyone got any other suggestions?

the real deal
September 27th, 2010, 11:55
i hope you guys now that he posted this for people who don't know how or didn't have the correct commands

no need to troll and flame him just because you know how to do all this.

Robbie D
January 24th, 2011, 00:21
It gives me errors, in my souce i add the commands in commands.txt and when i add this for the first time it gives me errors i dnt get the other part where u say add this in if you are usingyell for the first time where wld i put that??

Spice
March 19th, 2011, 19:34
code for ::ban? It doesn't seem to be working on my source.

EuphoricFantasy
March 19th, 2011, 19:45
Most modern sources now have ::yell and all those included. But this is good for a source from scratch.