Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace dxrk\WhiteListAdder;
- use pocketmine\command\Command;
- use pocketmine\command\CommandSender;
- use pocketmine\event\Listener;
- use pocketmine\event\player\PlayerDeathEvent;
- use pocketmine\plugin\PluginBase;
- use pocketmine\utils\Config;
- use pocketmine\utils\TextFormat;
- class Main extends PluginBase implements Listener{
- public function onEnable(){
- $this->getServer()->getPluginManager()->registerEvents($this, $this);
- $this->getLogger()->info(TextFormat::GREEN."WhiteList Adder Loaded");
- }
- public function PlayerDeathEvent(PlayerDeathEvent $ev){
- if($this->getServer()->hasWhitelist()){
- $name = $ev->getPlayer()->getName();
- $this->getServer()->getOfflinePlayer($name)->setWhitelisted(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement