Add an if statement, that checks the players inventory for the exact amount and removes the exact amount
|
I've added a dialogue that gives you dragon claws when you talk to an NPC. I've gotten it almost finished the only problem is that lets say you have 25M and claws were 25M , it takes the 25M and gives you claws BUT. you can just come with like 1GP and you'll still get the claws.. anybody know how I can make it so you need the exact amount of 25M? thanks.
Add an if statement, that checks the players inventory for the exact amount and removes the exact amount
this is what I have so far. doesn't work.Code:} else if(c.dialogueAction == 23) { if(!c.getItems().playerHasItem(995,25000000)); c.sendMessage("You don't have enough money!"); c.getPA().removeAllWindows(); c.getItems().addItem(14484,1); c.getItems().deleteItem(995, c.getItems().getItemSlot(995), 25000000); c.nextChat = 23;
YLol...
[code]
} else if(c.dialogueAction == 23) {
if(c.getItems().playerHasItem(995,25000000)) {
c.getPA().removeAllWindows();
c.getItems().addItem(14484,1);
c.getItems().deleteItem(995,
c.getItems().getItemSlot(995), 25000000);
c.nextChat = 23;
} else {
c.sendMessage("You need to suck a penis");
}
****Code:} else if(c.dialogueAction == 23) { if (c.getItems().playerHasItem(995,25000000)); c.getItems().addItem(14484,1); c.getItems().getItemSlot(995), 25000000); c.getItems().deleteItem(995, 25000000) } else { if (!c.getItems().playerHasItem(995,25000000)); c.sendMessage("You don't have enough money!"); c.getPA().removeAllWindows(); }
First of all. Your method was mixed up x500000.
You had it set to if the player does not have 25000000gp then it'll give the claws either way.
You need to pay attention to what you've coded imo.
EDIT: DAMMMIT. I'm lazy at coding.
So excuse my mistakes.
Also, i probably just fked that code up too. Hold on.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |