Config

Discussion in 'Plugin Development' started by TheGamesHawk2001, Aug 27, 2014.

Thread Status:
Not open for further replies.
  1. Does anyone know how I would put in a get config into this method (BELOW)

    I want it so in the config you can set the amount of money it withdraws from the players economy?
    I hope that made sense and my code is here :D

    Code:java
    1. Player p = (Player) sender;
    2. if(!sender.hasPermission("radiant.needfood"))
    3. return true;
    4. if (cmd.getName().equalsIgnoreCase("NeedFood")) {
    5. org.bukkit.inventory.PlayerInventory pi = p.getInventory();
    6. EconomyResponse r = econ.withdrawPlayer(p.getName(), 1000)
    7. pi.addItem(new ItemStack(Material.BAKED_POTATO, 128));
    8. sender.sendMessage (ChatColor.GREEN + "You have been supplied with 2 stacks of Baked Potato and 1,000 dollars has been taken out of your account!");
    9. }
     
  2. Offline

    Konkz

    PHP:
    int withdrawamt getConfig().getInt("info.withdraw");
    EconomyResponse r econ.withdrawPlayer(p.getName(), withdrawamt);
    I suggest looking on google and tutorials first, it's really simple how to use config.
     
  3. Offline

    mine-care

    What Konkz suggested and reading some docs wouldn't be bad.
     
Thread Status:
Not open for further replies.

Share This Page