here you gocase 116137:
if(itemId == 18820) {
c.getitems().deleteitem(18820);
c.getitems().deleteitem(995,5000000);
c.getItems().addItem(18820);
} else {
c.sendmessage("you don't have enough cash!");
}
|
please i really need this tried to do it but it failed
i need a code that when i click on a interface it will take a item and give me a different item and if i don't got it it will say i cant do it without this item! thanks
Don't laugh cause i am still really new to coding java and want to learn!
i tried making it but it failed
in clickingbuttons.java
please respect that i am trying to learn!Code:case 116137: ( if(itemId == 18820) { c.getitems().deleteitem(18820); c.getitems().deleteitem(995,5000000); c.getItems().addItem(18820); } else { c.sendmessage("you don't have enough cash!"); } )
here you gocase 116137:
if(itemId == 18820) {
c.getitems().deleteitem(18820);
c.getitems().deleteitem(995,5000000);
c.getItems().addItem(18820);
} else {
c.sendmessage("you don't have enough cash!");
}
Why the hell have you put brackets around it?
Code:case 116137: if(itemId == 18820) { c.getitems().deleteitem(18820); c.getitems().deleteitem(995,5000000); c.getItems().addItem(18820); } else { c.sendmessage("you don't have enough cash!"); } break;
i did that in the start...
but then i got this
and i get it again nowCode:src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym bol if(itemId == 18820) { ^ symbol: variable itemId location: class ClickingButtons src\server\model\players\packets\ClickingButtons.java:95: error: cannot find sym bol c.getitems().deleteitem(18820); ^ symbol: method getitems() location: variable c of type Client src\server\model\players\packets\ClickingButtons.java:96: error: cannot find sym bol c.getitems().deleteitem(995,5000000); ^ symbol: method getitems() location: variable c of type Client src\server\model\players\packets\ClickingButtons.java:97: error: method addItem in class ItemAssistant cannot be applied to given types; c.getItems().addItem(18820); ^ required: int,int found: int reason: actual and formal argument lists differ in length src\server\model\players\packets\ClickingButtons.java:99: error: cannot find sym bol c.sendmessage("you don't have enough cash!"); ^ symbol: method sendmessage(String) location: variable c of type Client Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 5 errors Press any key to continue . . .
Why are you even deleting item 18820 first and after that you add it ?
edit:
I think you want it that it will cost 5mil gp if im right and then it will add the item id 18820 if im right?
Code:case 116137: if(c.getItems().playerHasItem(995, 5000000)) { c.getItems().deleteItem(995, 5000000); c.getItems().addItem(18820, 1); } else { c.sendMessage("You don't have enough coins!"); } break;
ow lol didn't see that :O
so it suppose to look like this:
but still same errorCode:case 116137: if(itemId == 15707) { c.getitems().deleteitem(15707); c.getitems().deleteitem(995,5000000); c.getItems().addItem(18820); } else { c.sendmessage("you don't have enough cash!"); }
Code:src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym bol if(itemId == 15707) { ^ symbol: variable itemId location: class ClickingButtons src\server\model\players\packets\ClickingButtons.java:95: error: cannot find sym bol c.getitems().deleteitem(15707); ^ symbol: method getitems() location: variable c of type Client src\server\model\players\packets\ClickingButtons.java:96: error: cannot find sym bol c.getitems().deleteitem(995,5000000); ^ symbol: method getitems() location: variable c of type Client src\server\model\players\packets\ClickingButtons.java:97: error: method addItem in class ItemAssistant cannot be applied to given types; c.getItems().addItem(18820); ^ required: int,int found: int reason: actual and formal argument lists differ in length src\server\model\players\packets\ClickingButtons.java:99: error: cannot find sym bol c.sendmessage("you don't have enough cash!"); ^ symbol: method sendmessage(String) location: variable c of type Client Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 5 errors Press any key to continue . . .
>.> Learn to read compiler output and fix it yourself...
thanks but i don't want to tv
ok i changed it and made this:
but i still got one more problem please helpCode:case 116137: if(c.getItems().playerHasItem(995, 5000000)) { c.getItems().deleteItem(995, 5000000); c.getitems().deleteitem(15707, 1); c.getItems().addItem(18820, 1); } else { c.sendMessage("You don't have enough coins!"); } break;
Code:src\server\model\players\packets\ClickingButtons.java:94: error: cannot find sym bol c.getitems().deleteitem(15707, 1); ^ symbol: method getitems() location: variable c of type Client Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error Press any key to continue . . .
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |