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

Don't know how to fix

Discussion in 'Plugin Help' started by TheWalkingDrift, Jun 22, 2019.

  1. TheWalkingDrift

    TheWalkingDrift Silverfish

    Messages:
    23
    This is the Problem:
    [10:09:53] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected ')', expecting '{'" (EXCEPTION) in "plugins/teleporter/src/fixed/Main" at line 16

    And this is my code:

    <?php

    namespace Server;

    use pocketmine\plugin\PluginBase;
    use pocketmine\event\Listener;
    use pocketmine\command\CommandSender;
    use pocketmine\command\Command;
    use pocketmine\Player;
    use pocketmine\plugin\Plugin;
    use jojoe77777\FormAPI\SimpleForm;

    class Main extends Listener{

    public function openHelpUI(){
    $form = new SimpleForm(function(Player $player, int $data = null)) {
    $form->addbutton("§3Citybuild");
    }
    }

    public function onCommand(CommandSender $sender, string $commandLabel, array $args) {
    switch ($args[0]) {
    case "tpuicity":
    $this->openHelpUI($sender, "Menu Opened");
    }
    }
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    PHP:
    public function openHelpUI(Player $player,string $unknown){
    $form = new SimpleForm(function(Player $playerint $data null) {});
    $form->addbutton("§3Citybuild");
    $player->sendForm($form);
    }
     
  3. TheWalkingDrift

    TheWalkingDrift Silverfish

    Messages:
    23
    Thanks for Help, but there ist a new Problem:

    [20:12:02] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected ' ' (T_STRING), expecting '{'" (EXCEPTION) in "plugins/teleporter/src/fixed/Main" at line 16
    [20:12:02] [Server thread/DEBUG]: #0 ():
     
  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.