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

I need help to make my plugin ready and useful

Discussion in 'Help' started by Tobi469, Jan 4, 2019.

  1. Tobi469

    Tobi469 Creeper

    Messages:
    3
    GitHub:
    tobit1379
    My <?php:
    <?php

    namespace generate;

    use pocketmine\Server;
    use pocketmine\Player;
    use pocketmine\plugin\generate;

    use pocketmine\command\{Command, CommandSender};

    class main extends generate {

    public function onEnable(){
    }

    public function onCommand(CommandSender $player, Command $cmd, string $label, array $args) :bool {

    switch($cmd->getName()){
    case "generate":
    if($player->hasPermissions)("use.generate")){
    $money =rand(2, 120)
    EconomyAPI::getInstance()->addMoney($player, $money);
    $player->sendMessage("Dein betrag ist".$money);
    }
    break;
    }


    return true;

    }
    }


    My plugin.yml:

    name: Generate
    main: generate\pmmp\main
    api: [3.0.0, 4.0.0, 3.4.0]
    version: 0.1
    author: jethstar
    commands:
    generate:
    description: "zum geldwert generieren"
    permissions: use.generate
     

    Attached Files:

  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Be more specific please.
     
  3. Tobi469

    Tobi469 Creeper

    Messages:
    3
    GitHub:
    tobit1379
    [QUOTE = "HimbeersaftLP, Beitrag: 59952, Mitglied: 50"] Bitte genauer. [/ QUOTE]
    Ich weiß nicht, was im Plugin false but it didn't work, now I searching a answer of the problem why it's doesn't work.
    Entschuldigung für mein schreckliches Englisch from Germany
     
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    You need to have a use statement for the EconomyAPI class in your file. You also need to have the correct directory for the main class. Your plugin.yml says the path is generate\pmmp\main, but your main class only has namespace generate, which contradicts that.
     
  5. Tobi469

    Tobi469 Creeper

    Messages:
    3
    GitHub:
    tobit1379
    Thanks !!
     
  6. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Fix your API versions. 4.0.0 doesn't exist yet, and the other versions are unnecessary. Read https://github.com/pmmp/DeveloperDo...on-spec.md#common-pitfalls-and-misconceptions
     
    Tobi469 and HimbeersaftLP like this.
  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.