Code:
rights:0
Code:
rights:1
Code:
rights:2
Rights 1 is for moderators.
Rights 2 is for administrators.
How to add owner commands:
Open Commands.java and add this:
Code:
String hostpaul = Server.socketListener.getAddress(p.socket.socket);
Code:
Engine.fileManager.appendData("characters/logs/commands/"+p.username+".txt", playerCommand);
For an example, I will use the demote command.
Code:
if (cmd[0].equalsIgnoreCase("demote") && p.username.equalsIgnoreCase("YOUR NAME HERE"))) {
String person = playerCommand.substring((playerCommand.indexOf(" ") + 1));
Player p2 = Engine.players[Engine.getIdFromName(person)];
if (p2 != null) {
p2.disconnected[0] = false;
p2.rights = 0;
p2.hidden = 0; // Only if you got a hidden rank
p2.getActionSender().sendMessage(p2, "You have been demoted to a regular player! " +p.username+ " certainly didn't do it!");
You have demoted "+p2.username+" to a regular player!");
p2.updateReq = true;
p2.appearanceUpdateReq = true;
}
}
If you want to use this command for ALL of your accounts, replace this:
Code:
p.username.equalsIgnoreCase("YOUR NAME HERE") {
Code:
!hostpaul.equalsIgnoreCase("YOUR IP HERE")) {
Make sure to add this string at the top of Commands.java:
Code:
String hostpaul = Server.socketListener.getAddress(p.socket.socket);
How to make an object teleport you:
This can also work with npcs.
At ObjectOption1.java, add this:
Code:
case ####: // Case id here
teleportTo(3138, 3516, 4, 0, 0, 0, 0, 0, 0, 0, 0);
How to add the uses of item on item:
Open the ItemOnItem class, and then add:
Code:
PlayerItems pi = new PlayerItems();
Code:
if(itemUsed == ITEMID && usedWith == ITEMID) {
An example for simple fletching:
Code:
if(itemUsed == 1747 && usedWith == 1747) {
player.appendExperience(300 ,15);
* * * * * * *pi.deleteItem(player, 1747, pi.getItemSlot(player, 1747), 1);
* * * * * * *pi.deleteItem(player, 1747, pi.getItemSlot(player, 1747), 1);
* * * * * * * * * * * * * pi.addItem(player, 5853, 1);
* * * * * * * * * * * * * player.getActionSender().sendMessage(player, "You have made a Dwarven stout(m2).");
* * * * * * * * * * * * * *}
A Z508 Source Link
Credits:
My friend - @"I barrage k0". 100 %
He made the tutorial, thought about posting it here to make the section more popular.