It appears that Lifeboat servers have hided the system messages ( "x joined the game","y has left the game" etc.) . For a server having many players is a very good thing. How can I do it?
public function onJoin (PlayerJoinEvent $ev){ $ev->setJoinMessage(" "); } public function onQuit(PlayerQuitEvent $ev){ $ev->setQuitMessage(" "); }
Awesome cant wait to see it. I can make one two but I'm not good with config files yet. I'm still learning them
you could also modify the join and quit message example: $ev->setJoinMessage($ev->getPlayer()->getName() . " joined.");
public function onJoin (PlayerJoinEvent $ev){ $ev->setJoinMessage(''); } public function onQuit(PlayerQuitEvent $ev){ $ev->setQuitMessage(''); } public function onDeath(PlayerDeathEvent $ev){ $ev->setDeathMessage(''); } now the chat is fine xD dont want see the messages ^^
He has to implement the listener other wise the plugin wont build in DevTools. He said it works so I think he did.
Hmm not working for me? PHP: <?phpnamespace xFlare\SFBConfig;use pocketmine\plugin\PluginBase;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\Player;use pocketmine\event\player\PlayerQuitEvent;use pocketmine\event\player\PlayerDeathEvent;use pocketmine\Server;use pocketmine\event\Listener;class Main extends PluginBase implements Listener { public function onJoin (PlayerJoinEvent $ev){ $ev->setJoinMessage(''); return true; } public function onQuit(PlayerQuitEvent $ev){ $ev->setQuitMessage(''); return true; } public function onDeath(PlayerDeathEvent $ev){ $ev->setDeathMessage(''); return true;}?>
Using a YAML file to store it... PHP: public $config = new Config($directory_to_the_config . "Messages.yml", CONFIG::YAML) //You could use $this->getDataPath(); as the $directory//Assuming that you know how to work with YAML files and you already assigned the key values...public function onPlayerJoin(PlayerJoinEvent $event){ $event->setJoinMessage($this->config->get("join")); //You should assign the join message to the key "join" in this case}public function onPlayerQuit(PlayerquitEvent $event){ $event->setQuitMessage($this->config->get("quit")); //You should assign the quit message to the key "quit" in this case}