This is my first TUT so dont go hard on me its 100% done by me
Purpose: To make an npc spam a command, that makes people type it then they see a form to register an account for MOD,ADMIN (or in some servers premium)
hard to explain so ill ad pics of what exacly it is 
Difficulty: very simple 1/10
Assumed Knowledge: C+P, some Java would be useful
Server Base: I used - Hiyascape v2 - should work on all
Classes Modified: Client.java/server folder
Procedure.
STEP 1.
Open your server file
Right click,new,text file as shown below.
[IMG]
[/IMG]
name the file accounts.txt or payments if you play to charge real cash or any name you'd like.
Step 2.
ok now open up client.java
search
Code:
if (command.startsWith("suggest")
should look like.
Code:
if (command.startsWith("suggest")) {
sendMessage("Sending...");
sendMessage("Suggestion Succesfully Sent To Junior Rider!");
BufferedWriter bw = null;
String suggestion = command.substring(8);
try {
bw = new BufferedWriter(new FileWriter("suggestions.txt", true));
bw.write(playerName + ": " + suggestion);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error Suggesting");
}
}
}
}
if you dont have it add it under your commands
ok anyways rename "suggestions" to "register" the command ::modme or ::buymod ::buyadmin w/v you want it to be ill use ::modme.
should look like this now
Code:
if (command.startsWith("register")) {
sendMessage("Sending...");
sendMessage("account Succesfully Sent To Junior Rider!(make sure you added 2 spaces!");
BufferedWriter bw = null;
String suggestion = command.substring(8);
try {
bw = new BufferedWriter(new FileWriter("accounts.txt", true));
bw.write(playerName + ": " + suggestion);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error Suggesting");
}
}
}
}
step 3.
now we are going to add a menu! wooot
search in client.java
any menu you have even welcome screen
heres an example alot of servers should have this menu
Code:
} else if (command.equalsIgnoreCase("commands")) {
CommandHelpMenu();
or something simmular ok so under any menu add this
Code:
} else if (command.equalsIgnoreCase("modme")) {
modHelpMenu();
if you dont find your menus you can put it in with your commands.
we're almost done!
now look for
your welcome screen area should say sendquest(blah blah) or any of your menus under one add this
edit your text now one more thing!
Step 4.
open npchandler.java
search for add
Code:
if (npcs[i].npcType == 0) {
if (misc.random2(5) <= 2) {
npcs[i].updateRequired = true;
npcs[i].textUpdateRequired = true;
npcs[i].textUpdate = "type ::modme to become a mod! quick!.";
}
}
now open autospawn.java and add him to your coords not gona show this should be easy.
PICS:



