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

I need help with my plugin!!!

Comments in 'Plugin Development' started by Syriamanal, Nov 6, 2013.

?

What Shuld My next plugin be!!!

  1. Mine Shaft

    50.0%
  2. dungeons

    75.0%
Multiple votes are allowed.
  1. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    PHP:
    <?php

    /*
    __PocketMine Plugin__
    name=Instants MINI HOUSE
    version=1.0
    author=Syriamanal
    class=House
    apiversion=10
    */

    class House implements Plugin{
        private 
    $api$path;
        public function 
    __construct(ServerAPI $api$server false){
            
    $this->api $api;
        }
       
        public function 
    init(){
            
    $this->path $this->api->plugin->configPath($this);
            
    $this->config = new Config($this->path."config.yml"CONFIG_YAML, array());
        }
       
        public function 
    __destruct(){}
           
        }
       
        private function 
    House($player) {
            
    $level $player->level;
            
    $x $player->entity->x;
            
    $y $player->entity->y;
            
    $z $player->entity->z;
           
            
    $stone BlockAPI::get(98,0);
            
    $glass BlockAPI::get(20,0);
           
            
    $level->setBlock(new Vector3($x+1$y$z$level), $glass);
            
    $level->setBlock(new Vector3($x+1$y+1$z$level), $glass);
           
            
    $level->setBlock(new Vector3($x-1$y$z$level), $glass);
            
    $level->setBlock(new Vector3($x-1$y+1$z$level), $glass);
           
            
    $level->setBlock(new Vector3($x$y$z+1$level), $glass);
            
    $level->setBlock(new Vector3($x$y+1$z+1$level), $glass);
           
            
    $level->setBlock(new Vector3($x$y$z-1$level), $glass);
            
    $level->setBlock(new Vector3($x$y+1$z-1$level), $glass);
           
            
    $level->setBlock(new Vector3($x$y+2$z$level), $glass);
            
    $level->setBlock(new Vector3($x$y-1$z$level), $glass);

            
    $level->setBlock(new Vector3($x$y+3$z$level), $glass);
            
    $level->setBlock(new Vector3($x$y+1$z$level), $glass);

            
    $level->setBlock(new Vector3($x$y+4$z$level), $glass);
            
    $level->setBlock(new Vector3($x$y+2$z$level), $glass);

            
    $level->setBlock(new Vector3($x$y+5$z$level), $glass);
            
    $level->setBlock(new Vector3($x$y+3$z$level), $chest);
       
            
    $level->setBlock(new Vector3($x$y+6$z$level), $glass);
            
    $level->setBlock(new Vector3($x$y+3$z$level), $glass);
           
            
    $player->teleport(new Vector3($x$y$z));
        }
                            break;
                        case 
    "House"$this->House($player);
                       
                        
    $ms "$target has a MINI House Now!!!";
                    }
                   
            }
            return 
    $ms;
        }
       
        private function 
    overwriteConfig($dat){
            
    $cfg = array();
            
    $cfg $this->api->plugin->readYAML($this->path "config.yml");
            
    $result array_merge($cfg$dat);
            
    $this->api->plugin->writeYAML($this->path."config.yml"$result);
        }
       
    }
  2. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    I have errors
  3. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Can you please be more specific, you have a whole bunch of stuff that you cut from JudgeTroll that isn't really needed since your plugin doesn't use a YAML.
  4. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    Just help me it says error on line 27 and pleas help me
  5. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Do $issuer instead of $player
  6. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    Okt till has errorst
  7. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    Do I replace player at the x y z or at function house player
  8. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Every place you have $player, put $issuer
  9. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    OK thanks I still have errors can u run the plugin and see pleas
  10. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    How is the house building function called, I see no command registration
  11. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    I took a closer look at the code, there are a ton of errors in the public function house I would recommend really redoing it
  12. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    Can u give me the fixed errors thanks I will give u 50% credited
  13. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    If someone did that it would be like writing a brand new plugin. You should just listen to glitchmaster and rewrite it and we can work from there.
  14. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    No I just need the fixed errors and I will put them in and how did I get error I just used some of the code for the /troll some kid named jf
  15. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    ? Dude delete this plugin and start ALL over almost everything is wrong here. You need to register the command first in init you need to put $issuer and $data almost everything is wrong. And what the heck is $dat? Also your next plugin should be something simple not a Dungeon or mineshaft generator that will take even me months
  16. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    $dat is copied from JudgeTroll
  17. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Yes, yes it is
  18. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    I can start all over lol just tell me where the errors are
  19. Syriamanal
    Offline

    Syriamanal Ban Evader Banned

    Joined:
    Oct 2, 2013
    Posts:
    221
    Minecraft User:
    Syriamanal
    Sssssshhhhhhhh
  20. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    $dat is copied fro judgetroll might give him some credit using his code :p

Share This Page

Advertisement