1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

economyapi command

Discussion in 'Help' started by Habiba, Jan 13, 2018.

  1. Habiba

    Habiba Spider

    Messages:
    9
    GitHub:
    misu
    hello, how can I make a command cost money everytime i use it.
     
  2. Habiba

    Habiba Spider

    Messages:
    9
    GitHub:
    misu
    Please give me a example!
     
  3. QuiverlyRivalry

    QuiverlyRivalry Zombie Pigman

    Messages:
    491
    GitHub:
    quiverlyrivalry
    public function onCommand {
    //command code
    if ($money >= 5000) {
    //Code for command
    EconomyAPI::getInstance()->reduceMoney($player, 5000);
    }else{
    $player->sendMessage("You Don't Have Enough Money to do that command");
    }
    break;
     
  4. Habiba

    Habiba Spider

    Messages:
    9
    GitHub:
    misu
    thank you
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.