When I join it won't spawn me with armor. :'( PHP: public function init() { //Adds handler $this -> api -> addHandler("player.spawn", array($this, "Handler")); $this -> api -> addHandler("player.respawn", array($this, "Handler")); } public function Handler($data, $event) { switch($event){ case "player.spawn": $user =$player->iusername; //IF YOU WANT TO CHANGE IT EDIT THE VALUE IN () //HEAD $user->setArmor(0,$this->getArmor(298)); //BODY $user->setArmor(1,$this->getArmor(303)); //LEG $user->setArmor(2,$this->getArmor(304)); //FEET $user->setArmor(3,$this->getArmor(305));break; case "player.respawn": $user =$player->iusername; //IF YOU WANT TO CHANGE IT EDIT THE VALUE IN () //HEAD $user->setArmor(0,$this->getArmor(298)); //BODY $user->setArmor(1,$this->getArmor(303)); //LEG $user->setArmor(2,$this->getArmor(304)); //FEET $user->setArmor(3,$this->getArmor(305));break; } } //Thing I don't understand Lol public function __destruct() { } }?>
after the code case "player.spawn" : add $player =$this->api->player->getByEID($data->eid); try that if it works or not
Besides the fact that it doesnt spawn the player with armour, why dont you have the plugin generate a config file so that the server owner can edit the armour given without having to edit the actual code?