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

Solved Crazy error.

Comments in 'Plugin Development' started by Asparanc, Aug 7, 2015.

  1. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc
    Code:
    Error: syntax error, unexpected '$y' (T_VARIABLE)
    File: /Aventcube-Server-master/src/AventCube/Main
    Line: 251
    Type: E_PARSE
    
    THIS CRASH WAS CAUSED BY A PLUGIN
    
    Code:
    [242] $luck = 2+(0.1*$this->players["players"][$player]["excavation"]);
    [243] $nbr = round($this->players["players"][$player]["excavation"] / 50) + 1;
    [244] $lucky = mt_rand(1,1000) / 10;
    [245] $p = $event->getPlayer();
    [246] $x = $event->getPlayer()->getX();
    [247] $y = $event->getPlayer()->getY();
    [248] $z = $event->getPlayer()->getZ();
    [249] if ($lucky <= $luck){
    [250] for ($tt = 1; $tt < $nbr+1; $tt++){
    [251] $level->dropItem(new Vector3($x, $y, $z), Item::get(348));
    [252] }
    [253] }
    If someone can solve it :)
    HotFireyDeath likes this.
  2. Gamecrafter
    Offline

    Gamecrafter Notable Member Plugin Developer

    Joined:
    Nov 20, 2014
    Posts:
    981
    Plugins:
    9
    Did you use an IDE to check the code first? o_O
  3. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc
    I use DroidEdit because i work directly on android but it's not really an IDE..
  4. Gamecrafter
    Offline

    Gamecrafter Notable Member Plugin Developer

    Joined:
    Nov 20, 2014
    Posts:
    981
    Plugins:
    9
    No wonder... Mobile IDEs are horrrible. Check your code on a computer. ;)
    Asparanc likes this.
  5. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc
    The error appear when i've add this :

    PHP:
    $level $event->getLevel();
    $luck 2+(0.1*$this->players["players"][$player]["excavation"]);
    $nbr round($this->players["players"][$player]["excavation"] / 50) + 1;
    $lucky mt_rand(1,1000) / 10;
    $p $event->getPlayer();
    $x $event->getPlayer()->getX();
    $y $event->getPlayer()->getY();
    $z $event->getPlayer()->getZ();
    if (
    $lucky <= $luck){
    for (
    $tt 1$tt $nbr+1$tt++){
    $level->dropItem(new Vector3($x$y$z), Item::get(348));
    }
    }
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Try rewriting the whole line of code.
  7. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc
    That work now :O
    I've need it because i work on McMMOPE (from McMMO bukkit plugin)
  8. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Will you release it? That sounds like a big hit :)
  9. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc
    Not now because it will include : chat system, economy, McMMOPE, factions, ranks system, shops and kits :)
  10. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    I hope EconomyMaster! I wanna help too pm me.
  11. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc
    EconomyMaster it's quite a dead project, because of problems with Praxthisnovcht our team was deleted
  12. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    :( What did he do? Talk in pm lol.
  13. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    211
    Minecraft User:
    Asparanc

Share This Page

Advertisement