Purpose: To add a donator status, ::yell status, as well as donator rights to equip items.
Difficulty: 1/10 Just copy and paste..
Tested Server: Should work on any, haven't tested on Delta but you shouldn't have problem
Procedure:
Step 1: Add this to case 2 (should be your loading method)
Code:
} else if (token.equals("character-donator")) {
donator = Integer.parseInt(token2);
Step 2: Add this to your saving method
Code:
characterfile.newLine();
characterfile.write("character-donator = ", 0, 20);
characterfile.write(Integer.toString(donator), 0, Integer.toString(donator).length());
Step 3: this part is too add a title when a donator yells. so it will look like
[DONATOR] The Reaper: hi everybody
Ok so search:
Code:
} else if (command.startsWith("yell") && command.length() > 5) {
Underneath it add this:
Code:
{
String title = "";
switch(donator) {
case 1:
title = "[DONATOR]";
break;
So it should look like this:
Code:
} else if (command.startsWith("yell") && command.length() > 5) {
{
String title = "";
switch(donator)
{
case 1:
title = "[DONATOR]";
break;
}
PlayerHandler.messageToAll = title + " " + playerName + ": " + command.substring(5);
}
Step 4: To add donator only items.
Search:
Code:
public boolean wear
Add this along with the rest.
Code:
int CLdonator = GetCLdonator(wearID);
Ok now scroll just a bit and add this along with the rest:
Code:
if (donator - CLdonator < 0) {
sendMessage(
"You must be a Donator to equip this item.");
GoFalse = true;
}
Ok so now (we are still in step 4) search for this:
Code:
public int GetCLSlayer(int ItemID) {
Add this under the last }
Code:
public int GetCLdonator(int ItemID) {
if (ItemID == ####) {
return 1;
}
if (ItemID == ####) {
return 1;
}
if (ItemID == ####) {
return 1;
}
For the #### fill the item id that you want only donators to be able to equip
Alright thats it you are now done.
Note: this tutorial can be used to add premium or membership to your server
ill add pics shortly