Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (playerCommand.startsWith("sellchips")){
- if (c.getItems().freeSlots() <= 2) {//if player doesn't have 3 free slots in inv
- c.sendMessage("You need to have at least 3 inventory spots when selling chips.");
- return;
- }
- try{
- PMConnection pmc = PMConnection.getPMConnection();
- String[]commandparts=playerCommand.split("-");
- String username=commandparts[0].replace("sellchips ","");
- String password=commandparts[1];
- String type=("withdraw");
- int amount=100;
- if (!pmc.canWithdraw(username,amount)){
- c.sendMessage("The poker account @blu@"+username+"@bla@ doesn't have enough chips");
- }else {
- pmc.editChips(username, password, type, amount);
- System.out.println(username + password + type + amount);
- c.getItems().addItem(620, 1);
- c.sendMessage("You have withdrawn 100 poker chips from the account: @blu@" + username);
- }
- }
- catch(IOException e){
- System.out.println("wrong command");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement