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

Solved Syntax error, unexpected '$levelName'

Comments in 'Plugin Development' started by TheKillerTacos, Feb 7, 2016.

  1. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Help! Im fixing and old SkyBlock Plugin, but currently this appeared, im new on the newest API, so i really need help, since in less than 3 weeks i should release my server to public, and skyblock is going to be one of the first 2 Servers ill use, so here´s the complete error:

    Code:
    Parse error: syntax error, unexpected '$levelName' (T_VARIABLE) in phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/plugins/SkyBlock.phar/src/SkyBlock/Main.php on line 215
    
    Call Stack:
        0.0904     433832   1. {main}() C:\Users\XXXX\Desktop\IT Servers\ITSkyBlockPVP\PocketMine-MP.phar:0
        0.1044     428408   2. require_once('phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/PocketMine.php') C:\Users\XXXX\Desktop\IT Servers\ITSkyBlockPVP\PocketMine-MP.phar:1
        0.7076     570256   3. pocketmine\Server->__construct() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/PocketMine.php:442
        5.0888   24550856   4. pocketmine\plugin\PluginManager->loadPlugins() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/Server.php:1657
        5.8105   24994552   5. pocketmine\plugin\PluginManager->loadPlugin() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/plugin/PluginManager.php:276
        5.8150   25000000   6. pocketmine\plugin\PharPluginLoader->loadPlugin() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/plugin/PluginManager.php:132
        5.8214   25005496   7. class_exists() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/plugin/PharPluginLoader.php:44
        5.8215   25005664   8. spl_autoload_call() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/plugin/PharPluginLoader.php:44
        5.8215   25005688   9. BaseClassLoader->loadClass() phar://C:/Users/XXXX/Desktop/IT Servers/ITSkyBlockPVP/PocketMine-MP.phar/src/pocketmine/plugin/PharPluginLoader.php:44
    
    And here is the Bad code:

    PHP:
    $levelName $this->getServer()->getPlayer($name)->getLevel();
    I think that the $levelName isnt being set like the players name or something, help!
  2. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Show me the line before that. "Unexpected whatever" is usually when it was expecting something else.
    PEMapModder likes this.
  3. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Last edited: Feb 7, 2016
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    I added a Pull Request to fix the error.
    It was a simple syntax error. The line before line 215 was missing a ";"
    applqpak likes this.
  5. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Yeah, like I said whenever you get "Unexpected whatever" you're missing something on the line before it xD
  6. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Haha Thx, did not see that coming.
  7. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Still having the same error
  8. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    Help plz.
  9. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    With?
  10. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    having the same error,
  11. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    On the same line?
  12. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    No im sorry, the Github Repo wasnt updating so, i was building the bad plugin over and over again, now i have another problem which i can fix, let me see if i dont get anything wrong
  13. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Ok...?
  14. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    When i downloaded the Master.zip file, the Main.php wasnt Updated, so i was downloading the Defective version about 3 times, so THx for helping me!
  15. TheKillerTacos
    Offline

    TheKillerTacos Active Member

    Joined:
    Jan 21, 2016
    Posts:
    76
    Minecraft User:
    TheKillerTacos
    YAAAAAAAY! IT WORKED!
    applqpak likes this.
  16. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    No worries.
    TheKillerTacos likes this.

Share This Page

Advertisement