Solved Couldn't understand this

Discussion in 'Development' started by iBa4x, Mar 23, 2020.

  1. iBa4x

    iBa4x Silverfish

    Messages:
    24
    GitHub:
    iBa4x
    I got this error:
    Code:
    [22:10:20] [Server thread/CRITICAL]: ParseError: "syntax error, unexpected 'public' (T_PUBLIC)" (EXCEPTION) in "plugins/TEST 1/src/iBa4x/TeamDeathmatch/Main" at line 408
    [22:10:20] [Server thread/DEBUG]: #0 vendor/pocketmine/classloader/src/BaseClassLoader(124): BaseClassLoader->loadClass(string[25] iBa4x\TeamDeathmatch\Main)
    [22:10:20] [Server thread/DEBUG]: #1 (): BaseClassLoader->{closure}(string[25] iBa4x\TeamDeathmatch\Main)
    [22:10:20] [Server thread/DEBUG]: #2 (): spl_autoload_call(string[25] iBa4x\TeamDeathmatch\Main)
    [22:10:20] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginManager(165): class_exists(string[25] iBa4x\TeamDeathmatch\Main, boolean 1)
    [22:10:20] [Server thread/DEBUG]: #4 src/pocketmine/plugin/PluginManager(335): pocketmine\plugin\PluginManager->loadPlugin(string[69] C:\Users\iBa4x\Documents\Plugins\PocketMine\PocketMine\plugins\TEST 1, array[1])
    [22:10:20] [Server thread/DEBUG]: #5 plugins/PocketMine-DevTools (1) (1).phar/src/DevTools/DevTools(69): pocketmine\plugin\PluginManager->loadPlugins(string[63] C:\Users\iBa4x\Documents\Plugins\PocketMine\PocketMine\plugins\, array[1])
    [22:10:20] [Server thread/DEBUG]: #6 src/pocketmine/plugin/PluginBase(115): DevTools\DevTools->onEnable()
    [22:10:20] [Server thread/DEBUG]: #7 src/pocketmine/plugin/PluginManager(541): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    [22:10:20] [Server thread/DEBUG]: #8 src/pocketmine/Server(1783): pocketmine\plugin\PluginManager->enablePlugin(object DevTools\DevTools)
    [22:10:20] [Server thread/DEBUG]: #9 src/pocketmine/Server(1769): pocketmine\Server->enablePlugin(object DevTools\DevTools)
    [22:10:20] [Server thread/DEBUG]: #10 src/pocketmine/Server(1528): pocketmine\Server->enablePlugins(integer 0)
    [22:10:20] [Server thread/DEBUG]: #11 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[55] C:\Users\iBa4x\Documents\Plugins\PocketMine\PocketMine\, string[63] C:\Users\iBa4x\Documents\Plugins\PocketMine\PocketMine\plugins\)
    [22:10:20] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(296): pocketmine\server()
    [22:10:20] [Server thread/DEBUG]: #13 (11): require(string[110] phar://C:/Users/iBa4x/Documents/Plugins/PocketMine/PocketMine/PocketMine-MP.phar)
    line 408 is the beginning of this code:
    PHP:
            public function onEndGame(){
                
    $GameFile = new Config($this->getDataFolder()."Game/game.yml",Config::YAML);
                
    $TeamFile = new Config($this->getDataFolder()."Game/team.yml",Config::YAML);
                
    # action for player!
                
    $OnlinePlayer $this->getServer()->getOnlinePlayers();
                foreach(
    $OnlinePlayer as $player){
                    
    $name $player->getName();
                    
    $PlayerFile = new Config($this->getDataFolder()."Players/"$name .".yml",Config::YAML);
                    if(
    $PlayerFile->get("Team") == "RED" || $PlayerFile->get("Team") == "BLUE"){
                        
    $spawn $this->getServer()->getDefaultLevel()->getSafeSpawn();
                        
    $player->teleport(new Vector3($spawn->getX(),$spawn->getY(),$spawn->getZ()));
                        
    $player->getLevel()->addSound(new EndermanTeleportSound($player), $player->getLevel()->getPlayers());
                        if(
    $this->getWinner() == "BLUE"){
                            
    $player->sendMessage(TextFormat::GREEN."The".TextFormat::BLUE." BLUE ".TextFormat::GREEN."team has won!");
                        }
                        if(
    $this->getWinner() == "RED"){
                            
    $player->sendMessage(TextFormat::GREEN."The".TextFormat::RED." RED ".TextFormat::GREEN."team has won!");
                        }
                        
    $player->sendMessage(TextFormat::GREEN."MVP: ".$this->getMVP());
                        if(
    $this->getMVP() == $name){
                            
    $MVP $PlayerFile->get("MVP");
                            
    $PlayerFile->set("MVP",$MVP +1);
                            
    $PlayerFile->save();
                        }
                        
    $this->resetFile($name);
                    }
                }
            }
    I don't understand the error where exactly ..
     
  2. yuko fuyutsuki

    yuko fuyutsuki Witch

    Messages:
    74
    GitHub:
    fuyutsuki
    There should be a syntax error on the line above the function. Please look for it.
     
    HimbeersaftLP and iBa4x like this.
  3. iBa4x

    iBa4x Silverfish

    Messages:
    24
    GitHub:
    iBa4x
    Yes I found it thx :)
     

Share This Page

  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.