Crossed Out (Vault withdrawPlayer)

Discussion in 'Plugin Development' started by RainingTNT123, Jun 18, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    RainingTNT123

    So I was going to make a buying system them this cross out happened

    Red Means Cross out

    Code:
    case BOW:
          if (player.hasPermission("Kit.Archer")) {
          player.getInventory().clear();
          ItemStack archersword = new ItemStack(Material.STONE_SWORD);
          ItemMeta a = archersword.getItemMeta();
          a.setDisplayName("" + ChatColor.GOLD + ChatColor.BOLD + "Archer Sword");
          archersword.setItemMeta(a);
          player.getInventory().addItem(archersword);
      
          ItemStack archerbow = new ItemStack(Material.BOW);
          ItemMeta o = archerbow.getItemMeta();
          o.setDisplayName("" + ChatColor.GOLD + ChatColor.BOLD + "Archer Bow");
          archerbow.setItemMeta(o);
          archerbow.addEnchantment(Enchantment.ARROW_DAMAGE, 2);
          player.getInventory().addItem(archerbow);
      
          player.getInventory().addItem(new ItemStack(Material.ARROW, 16));
          for (int i = 0; i < 33; i++) {
              player.getInventory().addItem(new ItemStack(Material.MUSHROOM_SOUP));
            }
          player.chat("/effect @p clear");
          player.getInventory().setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
          player.getInventory().setHelmet(new ItemStack(Material.LEATHER_HELMET));
          player.getInventory().setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
          player.getInventory().setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
            player.closeInventory();
            player.sendMessage(String.format("%sYou selected kit %sArcher%s!", ChatColor.GREEN, ChatColor.GOLD, ChatColor.GREEN));
            break;
          } else {
              if (player.hasPermission("SoupPvP.Buy")); {
    // The Error
                  EconomyResponse r = econ.[COLOR=#ff0000]withdrawPlayer[/COLOR](player.getName(), 100);
              }
          


    When I hover over it says:

    EconomyResponse net.milkbowl.vault.economy.Economy.withdrawPlayer(String arg0, double arg1)
    @Deprecated

    Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.



    Please Help
    Thank you!
     
    Last edited by a moderator: Jun 18, 2018
  2. Offline

    timtower Moderator Moderator

  3. Offline

    RainingTNT123

    Can you type the code please.
    I don't know where to put the player object.
     
  4. Offline

    timtower Moderator Moderator

  5. Offline

    CommonSenze

    @RainingTNT123
    What @timtower is saying is that you just need to remove the .getName() method from the withdrawPlayer method. There are two withdrawPlayer methods with two types if arguments. The one you are using, the one that takes in the String of the players name as an argument, is no longer used because a better way of withdrawing money has come out. This better version is the one that has the player object as an argument. So all you need to do is just have the player variable in the parenthesis.
     
Thread Status:
Not open for further replies.

Share This Page