Change
if (c.inWild() && c.inFFA()) {
to
if(c.inWild()) {
?
|
okai so hears my pi item command currently you can spawn food in wild... i added the
c.inwild crap but still wont workk.. take a look please...
f(playerCommand.startsWith("item")||playerCommand. startsWith("pickup")) {
if (c.inWild() && c.inFFA()) {
c.sendMessage("Can't do this here bud");
return;
}
try
{
if (c.playerRights == 7 || c.playerRights == 6 || c.playerRights == 5)
{
return;
}
String[] args = playerCommand.split(" ");
if (args.length == 3)
{
int newItemID = Integer.parseInt(args[1]);
for(int i : restrictedItems) {
if(i == newItemID) {
c.sendMessage("This item can only be recieved via PKP Shop or Donator Shop.");
return;
}
}
int newItemAmount = Integer.parseInt(args[2]);
if(newItemAmount >= 2147483647) {
c.sendMessage("Please try spawning a lower amount of items.");
return;
}
if ((newItemID <= 21000) && (newItemID >= 0))
{
c.getItems().addItem(newItemID, newItemAmount);
c.sendMessage("You succesfully spawned @blu@" + newItemAmount +" @bla@of the item @red@" + newItemID + "@bla@.");
} else
{
c.sendMessage("That item ID does not exist.");
}
} else
{
c.sendMessage("Wrong usage: (Ex::item_ID_Amount)(::item 995 1))");
}
} catch (Exception e)
{
}
}
Change
if (c.inWild() && c.inFFA()) {
to
if(c.inWild()) {
?
but i have a dif area and there is a FFa area and i need it so that you cant spawn it there lol.. unless it wont matter because that is considered wild it self..
That says if a player is in the wild AND in FFA at the same time it will execute whatever is in the brackets.Code:if (c.inWild() && c.inFFA()) { c.sendMessage("Can't do this here bud"); return; }
So try this:
Code:if (c.inWild() || c.inFFA()) { c.sendMessage("Can't do this here bud"); return; }
Your conventions make me want to kill myself
Use this to auto-format your code: http://jsbeautifier.org/
Code:f(playerCommand.startsWith("item") || playerCommand.startsWith("pickup")) { if (c.inWild() && c.inFFA()) { c.sendMessage("Can't do this here bud"); return; } try { if (c.playerRights == 7 || c.playerRights == 6 || c.playerRights == 5) { return; } String[] args = playerCommand.split(" "); if (args.length == 3) { int newItemID = Integer.parseInt(args[1]); for (int i: restrictedItems) { if (i == newItemID) { c.sendMessage("This item can only be recieved via PKP Shop or Donator Shop."); return; } } int newItemAmount = Integer.parseInt(args[2]); if (newItemAmount >= 2147483647) { c.sendMessage("Please try spawning a lower amount of items."); return; } if ((newItemID <= 21000) && (newItemID >= 0)) { c.getItems().addItem(newItemID, newItemAmount); c.sendMessage("You succesfully spawned @blu@" + newItemAmount + " @bla@of the item @red@" + newItemID + "@bla@."); } else { c.sendMessage("That item ID does not exist."); } } else { c.sendMessage("Wrong usage: (Ex::item_ID_Amount)(::item 995 1))"); } } catch (Exception e) { } }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |