Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need Get player money code

Comments in 'Plugin Development' started by JUZEXMOD, Sep 22, 2016.

  1. JUZEXMOD
    Offline

    JUZEXMOD New Member

    Joined:
    May 28, 2016
    Posts:
    19
    Minecraft User:
    JUZEXMOD
    Hellow

    I need get player money

    Economy
  2. Blabla
    Offline

    Blabla Active Member

    Joined:
    Sep 19, 2015
    Posts:
    82
    Minecraft User:
    The_Beast_Inside
    Please make a proper threat description, 7 words is not quite enough to explain us what you want to do :p What economy plugin do you use? What part of the API usage do you not understand?
  3. EschieEsh
    Offline

    EschieEsh Active Member

    Joined:
    Jun 28, 2014
    Posts:
    69
    Minecraft User:
    Escherion
    Well, if you are using €¢onom¥$, you can find that information in its overview
    EconomyAPI.png
  4. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    400
    Plugins:
    2
  5. JonsMC
    Offline

    JonsMC Active Member

    Joined:
    Jul 26, 2016
    Posts:
    107
    Minecraft User:
    JonsMC
    this should work for you :)
    get money:
    PHP:
    EconomyAPI::getInstance()->myMoney($player);
    //it should return the player's money(INT)
    add money:
    PHP:
    EconomyAPI::getInstance()->addMoney($player$money);
    //$money must be numeric, ex: 1, 2, 3
    Reduce money:
    PHP:
    EconomyAPI::getInstance()->reduceMoney($player$money);
    //$money must be numeric, ex: 1, 2, 3
    While $player is the Player object(pocketmine\Player)
    And Don't forget to use onebone\economyapi\EconomyAPI; so EconomyAPI:: can works :)
    And remember to install EconomyAPI first
    (Full tutorial)
    Vaivez66 likes this.
  6. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    400
    Plugins:
    2
    Keep in mind that you can also replace $player with the string of player's name...

Share This Page

Advertisement