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

HELP WITH CODE!!!

Comments in 'Plugin Development' started by Legomite, Feb 17, 2014.

  1. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    It always says unexpected end of file! I even put tons of "}"!!!!!!!!!!!!!!
    PHP:
    case "player.block.touch" :
                    
    $username $issuer->username;
                    
    $target $data["target"];
                    
    $x $target -> x;
                    
    $y $target -> y;
                    
    $z $target -> z;
                   
    $this->api->console->run("tp ".$target." ".$x.".$y.".$z.");
                   break;
                   } 
                   }
                 
                   }
  2. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    42
    Minecraft User:
    ZexyZek
    Here i think:
    PHP:
    case "player.block.touch" :$username $issuer->username;$target $data["target"];$x $target -> x;$y $target -> y;$z $target -> z;$this->api->console->run("tp ".$target." ".$x." ".$y." ".$z.");
     break;
     } 
     }
     
     }
  3. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    42
    Minecraft User:
    ZexyZek
    Or if it wont work, Please put the whole code ;)
  4. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    755
    Plugins:
    2
    Minecraft User:
    Darunia18
    It would be better to work with the entire code. Just remember not to put any "}"s for no reason. They should only be used to close off any parts of code that are started with "{"s.
    BeastBajan15 likes this.
  5. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Don't worry, I fixed it. How come this won't tp a player?
    PHP:
    case "player.block.touch":
                  if(
    $data["item"]->getID() == $this->config->get("wand-item")){
                   
    $block $data["target"];
                    
    $x $block->x;
                    
    $y $block->y;
                    
    $z $block->z;
                    
    $target $this->config->get("tpplayer");
                    
    $this->api->console->run("tp ".$target$x$y$z."");
                   break;
  6. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    42
    Minecraft User:
    ZexyZek
    You didnt identify $block and whats the target ;) and the tp is wrong

    Should be:
    Code:
     $this->api->console->run("tp ".$data." . $x . " " . $y . " " . $z);
  7. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Umm, the $target is for teleporting the player to the block position
  8. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Umm,what's with the $data?
  9. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    42
    Minecraft User:
    ZexyZek
    Just use /tp <target> <position/player>
  10. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    That's what I did!
  11. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    42
    Minecraft User:
    ZexyZek
    Im sorry to make you mad :(
    But you dont need to make this plugin ;)
  12. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    I like making plugins,the tpplayer is the target player. This is what's suppose to happen. No steally!

    I'm making a trolling plugin and a cool feature I am adding is that you can tp a targeted player with a selected wand.

    For example.

    You want to troll GlitchMasterPE. You can do
    /troll-tp-target GlitchMasterPE
    Now when you use the targeted wand and tap on a block it will tp them to the blocks position.
    To set your wand,edit in config or possibly do /troll-wand 255
    (Ya I don't know what the ID is LOL)
    Then if it's set to iron hoe tap a block with the iron how and the teleporting will begin! Now this would be halarious for anonymous trolling without runnung the command in the console or chat.
  13. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    42
    Minecraft User:
    ZexyZek
    Use PMEss-PowerTool ;)
  14. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    ARE YOU SERIOUS?
  15. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    My plugin will be true API though!
  16. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    He is right. Let him make his own plugins.
  17. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The function $this->api->console->run($cmd) is like running commands on the console. There is only one paramrter, and so you should:
    $this->api->console->run("tp $player $x $y $z");
    Because on console you also do it like this

Share This Page

Advertisement