This should work!
if (playerCommand.startsWith("myshop")) {
if (c.inWild() || c.isInDungeon()) {// whatever you dungeon method is
return;
} else
c.getShops().openPlayerShop(c);
}
|
This is my command... how do I make it so players cannot use it in the wilderness and in Dungeoneering.
Code:if (playerCommand.startsWith("myshop")) { c.getShops().openPlayerShop(c); }
This should work!
if (playerCommand.startsWith("myshop")) {
if (c.inWild() || c.isInDungeon()) {// whatever you dungeon method is
return;
} else
c.getShops().openPlayerShop(c);
}
Use conventions and he didnt ask for the dung part.Code:if (playerCommand.startsWith("myshop")) { if (c.inWild()) { c.sendMessage("You cannot use this in the wilderness."); return; } else c.getShops().openPlayerShop(c); }
why use an else statement after a return?...
@ First reply, if all you're going to do is return the statement and not send any messages or anything then might as well just do
Code:if (playerCommand.startsWith("myshop") && !c.inWild() && !c.inDungeoneering()) c.getShops().openPlayerShop(c);
Im pretty sure he did ask for the dung part, roflUse conventions and he didnt ask for the dung part.
Im pretty sure he did ask for the dung part, roflUse conventions and he didnt ask for the dung part.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |