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

ArmorSpawn 3.0b

Makes your players spawn with armor

  1. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    LDX submitted a new plugin:

    ArmorSpawn - Makes your players spawn with armor

    Read more about this plugin...
    Lambo and iJoshuaHD like this.
  2. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    What respawning bug?
  3. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    It doesn't give players armor when they die, only when they join the game. No errors at all.
  4. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    PM me the code, and I will see what I can do.
  5. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
  6. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Try this:
    PHP:
    <?php
    /*
    __PocketMine Plugin__
    name=ArmorSpawn
    version=1.0
    author=LDX
    class=ArmorSpawn
    apiversion=12
    */
    class ArmorSpawn implements Plugin {
        private 
    $api;
        public function 
    __construct(ServerAPI $api$server false) {
            
    $this->api $api;
        }
        public function 
    init() {
            
    $this->path $this->api->plugin->configPath($this);
            
    $this->checkConfig();
            
    $this->api->addHandler("player.spawn",array($this,"spawn"));
            
    $this->api->addHandler("player.respawn",array($this,"respawn")); 
            
    console("[INFO] [ArmorSpawn] ArmorSpawn Enabled!");
        }
        public function 
    __destruct() { }
        private function 
    checkConfig() {
            if(!
    file_exists($this->path "config.yml")) {
                
    file_put_contents($this->path "config.yml",yaml_emit(array("enabled" => "false","head" => "298","chest" => "299","legs" => "300","feet" => "301")));
            } 
        }
        public function 
    spawn($data) {
            
    $this->equip($data);
        }
        public function 
    respawn($data){
            
    $this->equip($data);
        }

        public function 
    equip($plyer){
            
    $this->checkConfig();
            
    $config yaml_parse(file_get_contents($this->path "config.yml"));
            if(
    $config["enabled"] == "true") {
                
    $head $config["head"];
                
    $chest $config["chest"];
                
    $legs $config["legs"];
                
    $feet $config["feet"];
                if(
    $plyer->getArmor(0) == $this->api->block->getItem(0,0,0)) {
                    
    $plyer->setArmor(0,$this->api->block->getItem($head));
                }
                if(
    $plyer->getArmor(1) == $this->api->block->getItem(0,0,0)) {
                    
    $plyer->setArmor(1,$this->api->block->getItem($chest));
                }
                if(
    $plyer->getArmor(2) == $this->api->block->getItem(0,0,0)) {
                    
    $plyer->setArmor(2,$this->api->block->getItem($legs));
                }
                if(
    $plyer->getArmor(3) == $this->api->block->getItem(0,0,0)) {
                    
    $plyer->setArmor(3,$this->api->block->getItem($feet));
                }
            }
        }
    }
    ?>
    technotim75 likes this.
  7. aSkel
    Offline

    aSkel New Member

    Joined:
    Sep 1, 2014
    Posts:
    6
    Minecraft User:
    aSkel
    We add this to the plugin folder? I don't see the plugin load.
    and is it possible to make it for specific players only? (VIP, OPs, Mods, etc.,)
  8. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    It's only for the old API right now.
  9. aSkel
    Offline

    aSkel New Member

    Joined:
    Sep 1, 2014
    Posts:
    6
    Minecraft User:
    aSkel
    Ohh, okay. Thanks. Used it once.. I think.. But now it doesn't work. But it's a good plugin.
    LDX likes this.
  10. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
  11. Creeperminer
    Offline

    Creeperminer Active Member

    Joined:
    Oct 12, 2014
    Posts:
    81
    Minecraft User:
    Creeperminer
    Is there anyway to change the items equiped when joining?
  12. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    Yes, it's called editing the config.
  13. TonyDroidd
    Offline

    TonyDroidd Active Member

    Joined:
    Sep 6, 2014
    Posts:
    180
    Minecraft User:
    TonyDroidd
    i added to vip group the permission armorspawn.receive, but they no join with armor :/
    Creeperminer likes this.
  14. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    I can't get my own plugin to work. :/
    CODE TIME
    Creeperminer likes this.
  15. Creeperminer
    Offline

    Creeperminer Active Member

    Joined:
    Oct 12, 2014
    Posts:
    81
    Minecraft User:
    Creeperminer
    Where is the config for the armor? I looked for it I coul find it
  16. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    It gets created after a player spawns. I meant to fix that.
    Creeperminer likes this.
  17. Creeperminer
    Offline

    Creeperminer Active Member

    Joined:
    Oct 12, 2014
    Posts:
    81
    Minecraft User:
    Creeperminer
    Oh ok thank you
    LDX likes this.
  18. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
  19. TrueBaccaAli
    Offline

    TrueBaccaAli Active Member

    Joined:
    Apr 6, 2015
    Posts:
    71
    Could you add this 1 feature to this plugin please? So I was thinking that you could also spawn 3 additional items such as a bow, with 64 arrows and a diamond sword. That would be awesome and interesting.
  20. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,429
    Plugins:
    14
    Use SpawnWithItems. :)
    Ed_Lan_Develope likes this.

Share This Page

Advertisement