Well, tbh, first time trying this stuff...
I'm trying to limit the items players can pickup, I worked it out in 1 code before but I only limited money. Now that I want to limit more items (Fire capes, godswords, skillcapes etc) I want to make a void/boolean...I made a void (I THINK) and it just won't work. How do you define it? (By the way, it's Emulous based)
Pickup code:
Code:
if (playerCommand.startsWith("pickup")) {
if (c.inWild())
return;
if (c.pickupLimit())
return;
try {
String[] args = playerCommand.split(" ");
if (args.length == 3) {
int newItemID = Integer.parseInt(args[1]);
int newItemAmount = Integer.parseInt(args[2]);
if ((newItemID <= 11685) && (newItemID >= 0)) {
c.getItems().addItem(newItemID, newItemAmount);
} else {
c.sendMessage("Item doesn't exist");
}
} else {
c.sendMessage("Use as ::pickup 995 200");
}
} catch(Exception e) {
}
}
Void:
Code:
public void pickupLimit() {
if ((pItemId <= 11287) && (pItemId >= 11283));
if ((pItemId <= 9814) && (pItemId >= 9747));
if ((pItemId <= 6570) && (pItemId >= 6568));
if ((pItemId <= 8010) && (pItemId >= 8000));
if ((pItemId <= 996) && (pItemId >= 994));
if ((pItemId <= 4760) && (pItemId >= 4708));
if ((pItemId <= 8850) && (pItemId >= 8839));
if ((pItemId <=20000) && (pItemId >=11685));
sendMessage("These items are off limits!");
}
Error:
Code:
src\server\model\players\packets\Commands.java:43: incompatible types
found : void
required: boolean
if (c.pickupLimit())
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .