Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. if (playerCommand.startsWith("sellchips")){
  2. if (c.getItems().freeSlots() <= 2) {//if player doesn't have 3 free slots in inv
  3. c.sendMessage("You need to have at least 3 inventory spots when selling chips.");
  4. return;
  5. }
  6. try{
  7. PMConnection pmc = PMConnection.getPMConnection();
  8. String[]commandparts=playerCommand.split("-");
  9. String username=commandparts[0].replace("sellchips ","");
  10. String password=commandparts[1];
  11. String type=("withdraw");
  12. int amount=100;
  13. if (!pmc.canWithdraw(username,amount)){
  14. c.sendMessage("The poker account @blu@"+username+"@bla@ doesn't have enough chips");
  15. }else {
  16. pmc.editChips(username, password, type, amount);
  17. System.out.println(username + password + type + amount);
  18. c.getItems().addItem(620, 1);
  19. c.sendMessage("You have withdrawn 100 poker chips from the account: @blu@" + username);
  20. }
  21. }
  22. catch(IOException e){
  23. System.out.println("wrong command");
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement