Not a rank yet. You have to make something of it to make it a rank.
|
|
This is going to be a tutorial for adding ranks to your players in the character files. This is a super easy task to perform once you get the hang of it. If you have any questions about this either reply to this thread, private message me, or send me an email at '[email protected]'.
Step 1:
In your Player.java folder
Src > Server > Model > Players > Player.java
Search:
Add:Code:public int playerRights;
Code:public int donator;
Step 2:
In your PlayerSave.java folder
Src > Server > Model > Players > PlayerSave.java
Search:
Add:Code:p.playerRights = Integer.parseInt(token2);
Code:} else if (token.equals("character-donator")) { p.donator = Integer.parseInt(token2);
Step 3:
In your PlayerSave.java folder
Src > Server > Model > Players > PlayerSave.java
Search:
Add:Code:characterfile.write("character-rights = ", 0, 19); characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length()); characterfile.newLine();
Code:characterfile.write("character-donator = ", 0, 20); characterfile.write(Integer.toString(p.donator), 0, Integer.toString(p.donator).length()); characterfile.newLine();

Not a rank yet. You have to make something of it to make it a rank.
What do you mean "Make something of it"? All that it is, basically, you add this code, and then if you want to make a command for donators only, you will restrict it so that only people with "character-donator = 1" in their character file can use the command. To me, that sounds like a rank.

^ because it is a rank..

No. it's an int/boolean saving to your character. You have to make something of it, e.g donator island.

Code:case 108003: if (c.character-donator == 1 || c.playerRights >= 1) { c.setSidebarInterface(4, 27620); } else { c.sendMessage("You must be an donator to view this tab!"); return; } break; case 107231: if (c.character-donator == 1 || c.playerRights >= 1) { c.getPA().spellTeleport(2036, 4525, 0); c.sendMessage("You teleported to donator-zone a place to chill/relax, theres also alot of benefits."); } else { c.sendMessage("You must be an donator to teleport to the donator-zone!"); return; } break;![]()
This is a rank. You need this to be able to make things for donators only.
Easy but good job.
| « My godmode thingy | [Azure] Fletching » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
| Tags for this Thread |