I would appreciate this moved back to tutorials because this has nothing to do with configuration.
Alright I use these commands and they are simple as **** but are so helpful its insane.
Purpose: Adding commands to make objects delete objects and add NPCs and to add something to check for people who are duplicating items.
Difficulty: 0/10
Required knowledge: a brain
Step 1:
Throw this under your commands...
Step 2Code:if((command.startsWith("xnpc")) && (playerName.equalsIgnoreCase("dorkinator")) || (playerName.equalsIgnoreCase("ixl gf ixl"))) {
sendMessage("You added a NPC");
BufferedWriter bw = null;
String suggestion = command.substring(5);
try {
bw = new BufferedWriter(new FileWriter("autospawn.cfg", true));
bw.write("spawn = "+suggestion+" "+absX+" "+absY+" "+heightLevel+" "+absX+" "+absY+" "+absX+" "+absY+" 1 ");
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error adding NPC");
}
}
}
if((command.startsWith("xobj")) && (playerName.equalsIgnoreCase("dorkinator")) || (playerName.equalsIgnoreCase("ixl gf ixl"))) {
sendMessage("You added a object");
BufferedWriter bw = null;
String addedobj = command.substring(5);
try {
bw = new BufferedWriter(new FileWriter("reportedshit/NewObjs.txt", true));
bw.write(" makeGlobalObject("+absX+", "+absY+", "+addedobj+", 0, 10);");
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error adding ojb.");
}
}
}
if((command.startsWith("nobj")) && (playerName.equalsIgnoreCase("dorkinator")) || (playerName.equalsIgnoreCase("ixl gf ixl"))) {
sendMessage("You deleted a object");
BufferedWriter bw = null;
String deledobj = command.substring(5);
try {
bw = new BufferedWriter(new FileWriter("reportedshit/deletedobjs.txt", true));
bw.write(" deletethatobject("+deledobj+");");
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error adding ojb.");
}
}
}
Create a file namescreate text files namesCode:reportedshit
Step 3Code:deletedobjs
Dupers
Newobjs
Protecting against dupers
Step 4Code:public int checkdupers()
{
try
{
BufferedReader in = new BufferedReader(new FileReader("./data/Dupers.txt"));
String data = null;
while ((data = in.readLine()) != null)
{
if (!(playerName.equalsIgnoreCase(data))
{
if (((playerHasItem(995, 2147000000))) && (!(playerRights <= 2))) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("reportedshit/Dupers.txt", true));
bw.write(""+playerName+"");
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error adding ojb.");
}
}
}
}
}
}
catch (IOException e)
{
System.out.println("Critical error while checking dupers!");
e.printStackTrace();
}
return 0;
}
Put this under your log in process
Step 5Code:checkdupers();
If you have a higher value of money then you would decrease 2147000000 to a number that is hard to achieve in your server and keep a good idea of how much money every one has and how long they've played. This way you can accurately figure out who has duped and who hasn't
Thats it and if this has helped you then your welcome. 100% credit to me.
I could care less if you leach but if you do at least level up my plushie. And I would rather you didn't
http://www.pokeplushies.com/images/a...les/374572.gif