Vault withdrawing money from users account issue

Discussion in 'Plugin Development' started by mineforfun, Aug 28, 2013.

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


    OK i just fixed a lot of bugs in my plugin and now i have added vault to make it better :D. but when i run the server i get an error saying therer is a issue with this line:

    EconomyResponse r = econ.withdrawPlayer(player.getName(), plugin.getConfig().getInt("Word_Fuck_Cost"));
    I want the amount that a player is charged to come from the config.yml here is the segment from the config.yml i am calling on
    so is there another way i should be trying to withdraw the money ?
    -Thank you
  2. For all we know the error is caused by your server being out of bacon, post the error stacktrace perhaps??
    Eats_Rainbows likes this.
  3. Offline


  4. Caused by: java.lang.NullPointerException
    at me.gerard2202.Firstplugin.Chat_listen.onPlayerChat(

    so, one of the variables on that line has not been set to a value. Have a look and figure out which one hasn't been given a value.
  5. Offline


    what i was saying is that line 49 is:
    EconomyResponse r = econ.withdrawPlayer(player.getName(), plugin.getConfig().getInt("Word_Fuck_Cost"));
    and the config looks just like this :

    so i have given it a value :S
  6. econ, player and plugin are variables on that line.

    One of them, or possibly all, have not been given values according to that error message.

    Not the config.yml, the actual java variables.
  7. Offline


    *Time to sound dumb* i do not get what you are talking about
  8. post the file and i'll point them out.
  9. Offline


  10. Ok, assuming that you're actually passing your plugin class to the Chat_listen's constructor and you don't do anything funky like call the event somewhere else without a player, you haven't initialised the econ field.

    If you look at vault's dbo page it tells you how to do this.
  11. Offline


    Hey i got the same problem but i didn't foud the awnser! I am making a command (/heal) but I want that player pay for that command. But how can i setup that in the config?
    EconomyResponse r = econ.withdrawPlayer(p.getName(), getconfig().getInt("Heal"));
    if (r.transactionSuccess()){
    } else {
    p.sendMessage("§cYou need more money " + p.getName() + "!");
Thread Status:
Not open for further replies.

Share This Page