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

Crash with Plugin

Comments in 'Plugin Development' started by Survingo, Dec 17, 2015.

Thread Status:
Not open for further replies.
  1. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    I edited Minifixio's 1vs1 Plug 'cause everyone can reference a arena. But now I get some syntax error :(
    Code:
    [Server] Parse error: syntax error, unexpected ':', expecting ',' or ';' in /storage/sdcard0/PocketMine/plugins/§lHydraPvP§r/src/Minifixio/onevsone/command/JoinCommand.php on line 21
    [Server] [20:05:56] [Server thread/EMERGENCY]: Ein nicht-behebbarer Fehler ist aufgetreten und der Server stürzte ab. Erstelle einen Crash-Dump...
    So, heres the error file (I get an error with the ':' after the command name :confused:)
    Code:
    <?php
    
    namespace Minifixio\onevsone\command;
    
    use pocketmine\command\Command;
    use pocketmine\command\PluginIdentifiableCommand;
    use pocketmine\command\CommandSender;
    use pocketmine\level\Level;
    use pocketmine\Player;
    use pocketmine\Server;
    use pocketmine\utils\TextFormat;
    
    
    use Minifixio\onevsone\OneVsOne;
    use Minifixio\onevsone\ArenaManager;
    
    class JoinCommand extends Command implements PluginIdentifiableCommand{
    
        private $plugin;
        private $arenaManager;
        public $commandName = "pvp":
    
    if($sender instanceof Player){
                            if($sender->hasPermission("hydrapvp.join")){
                                $this->plugin->JoinCommand($sender);
                                return true;
                            }else{
                                $sender->sendMessage($this->plugin->translateColors("&", "&cYou don't have permissions to use this command"));
                                return true;
                            }
    
        public function __construct(OneVsOne $plugin, ArenaManager $arenaManager){
            parent::__construct($this->commandName, "Betrete die Warteschlange für HydraPvP!");
            $this->setUsage("/$this->commandName");
           
            $this->plugin = $plugin;
            $this->arenaManager = $arenaManager;
        }
    
        public function getPlugin(){
            return $this->plugin;
        }
    
        public function execute(CommandSender $sender, $label, array $params){
            if(!$this->plugin->isEnabled()){
                return false;
            }
    
            if(!$sender instanceof Player){
                $sender->sendMessage("Please use the command in-game");
                return true;
            }
           
            $this->arenaManager->addNewPlayerToQueue($sender);
           
            return true;
        }
    }
    
  2. Intyre
    Offline

    Intyre Staff Member PocketMine Team

    Joined:
    Aug 24, 2013
    Posts:
    118
    Minecraft User:
    Intyre
    Parse error: syntax error, unexpected ':', expecting ',' or ';' in JoinCommand.php on line 21

    Please read the error!
    PEMapModder and CraftYourBukkit like this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement