PHP: public function onLoad(){ @mkdir($this->getDataFolder()); $this->SpleefOne = (new Config($this->getDataFolder()."SpleefOne.yml", Config::YAML, array( "Join-Spleef-One-Message" => TextFormat::RED."[Spleef]".TextFormat::YELLOW."Joining Spleef Lobby One!", "Spleef_One_Players" => 0, "Spleef_One_In_Progress" => false, "SpleefOnePlayerOne" => null, "SpleefOnePlayerTwo" => null, "SpleefOnePlayerThree" => null, "SpleefOnePlayerFour" => null, "SpleefOnePlayerFive" => null, "SpleefOnePlayerSix" => null, "SpleefOnePlayerSeven" => null, "SpleefOnePlayerEight" => null, "max-players" => 8, ))); $this->getLogger()->info(TextFormat::BLUE."CloudPvP Spleef"); } (YAML) Code: --- Join-Spleef-One-Message: §c[Spleef]§eJoining Spleef Lobby One! Spleef_One_Players: 0 Spleef_One_In_Progress: false SpleefOnePlayerOne: ~ SpleefOnePlayerTwo: ~ SpleefOnePlayerThree: ~ SpleefOnePlayerFour: ~ SpleefOnePlayerFive: ~ SpleefOnePlayerSix: ~ SpleefOnePlayerSeven: ~ SpleefOnePlayerEight: ~ max-players: 8 ... PHP: public function onPlayerInteract(PlayerInteractEvent $event){ $p = $event->getPlayer(); $tile = $event->getBlock()->getLevel()->getTile($event->getBlock()); if ($tile instanceof Sign) { $tiles = $tile->getText(); if ($tiles[0] == "[CloudPvP]" and $tiles[1] == "Spleef"){ $tile->setText($tiles[0], $tiles[1], $this->SpleefOne->get("Spleef_One_In_Progress"), $this->SpleefOne->get("Spleef_One_Players"). "/" . $this->SpleefOne->get("max-players")); if ($this->SpleefOne->get("Spleef_One_In_Progress") == false and $this->SpleefOne->get("Spleef_One_Players") < 8){ $p->sendMessage($this->SpleefOne->get("Join-Spleef-One-Message")); $this->SpleefOne->get("Spleef_One_Players"); $this->SpleefOne->get("Spleef_One_In_Progress") == false and $this->SpleefOne->get("Spleef_One_Players")+1; if ($this->SpleefOne->get("SpleefOnePlayerOne") == null or $this->SpleefOne->get("SpleefOnePlayerOne")->isOnline() == false) { $event->getPlayer()->teleport(new Vector3(-1206, 26, 280)); $p->sendMessage(TextFormat::RED."[Spleef] Please Wait."); $item = Item::get(256,0,1); $p->getInventory()->addItem($item); $this->SpleefOne->get("SpleefOnePlayerOne") = $this->p->getName(); } } } } } On the PHP code above, on the last line of text (which is obviously wrong and crashes the server) how do I correctly assign SpleefOnePlayerOne as $p's name in the config file?
well no crash but when i checked the config file (yes I did refresh) but SpleefOnePlayerOne was still set to null
There is other stuff wrong with that code but if you are looking for a fix for that line, you should have PHP: $this->SpleefOne->set("SpleefOnePlayerOne", $p->getName());