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

Solved My plugin with economyapi ?

Comments in 'Plugin Development' started by KHAV, Sep 1, 2016.

  1. KHAV
    Offline

    KHAV New Member

    Joined:
    Aug 7, 2016
    Posts:
    35
    Minecraft User:
    KHAV
    Hi Guys

    I want To make On My Plugin When You Type Command look like /gift

    Take from the player money same 100,200,300 ....

    So how i can do this ?:)
  2. R7vmc
    Offline

    R7vmc New Member

    Joined:
    Aug 2, 2016
    Posts:
    22
    Minecraft User:
    R7vmc
    I didn't understand anything :/
  3. R7vmc
    Offline

    R7vmc New Member

    Joined:
    Aug 2, 2016
    Posts:
    22
    Minecraft User:
    R7vmc
    maybe you mean when you type /gift he give player money ?
  4. R7vmc
    Offline

    R7vmc New Member

    Joined:
    Aug 2, 2016
    Posts:
    22
    Minecraft User:
    R7vmc
    or you want to take money from the player ?
  5. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    PHP:
    EconomyAPI::getInstance()->reduceMoney($player,$money);
  6. R7vmc
    Offline

    R7vmc New Member

    Joined:
    Aug 2, 2016
    Posts:
    22
    Minecraft User:
    R7vmc
    It's command not event or other
    PHP:
    EconomyAPI::getInstance()->reduceMoney($sender$money); 
  7. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    I just can't understand why some people don't look it up -.- it's much easier than registration > confirm > and making and thread, but if you want it the hard way here it is :
    PHP:
    //on command
    if(!$sender instanceof Player) return;
    $econ $this->getServer()->getPluginManager()->getPlugin("EconomyAPI");
    if(
    $econ){
    switch (
    strtolower ($cmd->getName())){
    case 
    "gift1":
    $econ->reduceMoney($sender100);
    //Do stuff
    Break;
    }
    }


  8. KHAV
    Offline

    KHAV New Member

    Joined:
    Aug 7, 2016
    Posts:
    35
    Minecraft User:
    KHAV
    Thx Man,Solved

Share This Page

Advertisement