Jump to content
  • 0
Sign in to follow this  
madman

setting a cap on how much you can buy in ge

Question

[code]
case 162:
if(player.getTemporaryAttribute("buying") == Boolean.TRUE) {
amount += 1;
} else {
amount = 1;
}
break;
case 164:
if(player.getTemporaryAttribute("buying") == Boolean.TRUE) {
amount += 10;
} else {
amount = 10;
}
break;
case 166:
if(player.getTemporaryAttribute("buying") == Boolean.TRUE) {
amount += 100;
} else {
amount = 100;
}
break;
case 168:
if(player.getTemporaryAttribute("buying") == Boolean.TRUE) {
amount += 1000;
} else {
amount = player.getInventory().getContainer().getNumberOff(id);
}
break;
[/code]


how would i add a cap to how much you can buy in a ge

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
does any1 know how to do this?

Share this post


Link to post
Share on other sites
  • 0
By a cap, do you mean like...
You can only put an offer in for... 2000 at a time.
Or do you mean * per 4 hours.

For the 2000 in an offer at a time.
Simply make a check when it's doing the amount+= *; like this:
[CODE]if(amount+= * >= 2000) {
amount = 2000;
}[/CODE]

If you mean buying * per 4 hours, then it would completely depend on your own code, and you'd have to write the buying system to only buy if the player hasn't bought * in 4 hours.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×