0wned You
December 23rd, 2010, 00:50
Ok, so I just worked this up, since I thought you guys might want it.
It's not that hard, so as long as you can follow directions, you should be fine.
Files needed: CommandPacketHandler.java
CommandsPacketHandler.java
1.) First, open up the files and search for
if(cmd[0].equals("item"))
in CommandPacketHandler.java
and
if(cmd[0].equals("::item"))
in CommandsPacketHandler.java
2.) In CommandPacketHandler.java, you should see that the beginning of the code looks like this:
if(cmd[0].equals("item")) {
if (cmd.length == 2 || cmd.length == 3) {
int item = Integer.valueOf(cmd[1]);
int amount = 1;
Press enter for a new line right after
int amount = 1;
and post this
if(item == ####) { //where #### is the item id
if(!player.getUsername().equals("myusername")) {
//or change "(!player.getUsername().equals("myusername"))"
//to "(!player.getRights < #))" where # is the rights of the player
player.getActionSender().sendMessage("This item can only be obtained by myusername!");
//or change "myusername" to something like "Admins"
return;
}
}
Then open up CommandsPacketHandler.java, and the same line of code like in CommandPacketHandler.java:
int item = Integer.valueOf(cmd[1]);
and add the exact same thing as you did in CommandPacketHandler.java.
That's it, compile and run! Thanks for reading and using this!
--0wned You
It's not that hard, so as long as you can follow directions, you should be fine.
Files needed: CommandPacketHandler.java
CommandsPacketHandler.java
1.) First, open up the files and search for
if(cmd[0].equals("item"))
in CommandPacketHandler.java
and
if(cmd[0].equals("::item"))
in CommandsPacketHandler.java
2.) In CommandPacketHandler.java, you should see that the beginning of the code looks like this:
if(cmd[0].equals("item")) {
if (cmd.length == 2 || cmd.length == 3) {
int item = Integer.valueOf(cmd[1]);
int amount = 1;
Press enter for a new line right after
int amount = 1;
and post this
if(item == ####) { //where #### is the item id
if(!player.getUsername().equals("myusername")) {
//or change "(!player.getUsername().equals("myusername"))"
//to "(!player.getRights < #))" where # is the rights of the player
player.getActionSender().sendMessage("This item can only be obtained by myusername!");
//or change "myusername" to something like "Admins"
return;
}
}
Then open up CommandsPacketHandler.java, and the same line of code like in CommandPacketHandler.java:
int item = Integer.valueOf(cmd[1]);
and add the exact same thing as you did in CommandPacketHandler.java.
That's it, compile and run! Thanks for reading and using this!
--0wned You