On a PlayerQuitEvent you can check if the freeze array using isset() PHP: public function onQuit(PlayerQuitEvent $e){ if(isset($this->freeze[$event->getPlayer()->getName()])) // no copying or it will fail :P $e->getPlayer()->setBanned(true);}
Help I got clear sky lite crash undefined variable on line 42 in my plugin PHP: if(isset($this->freeze[$event->getPlayer()->getName()])) // no copying or it will fail :P Me not know PHP so I copy code help pls sry for bad eng thx
PHP: public function onQuit(PlayerQuitEvent $event){ $player = $event->getPlayer(); if(isset($this->ban[$player->getName()])){ $this->getServer()->getNameBans()->addBan($player->getName()); } } Try this
You can try this: PHP: public $ban = array(); public function onQuit(PlayerQuitEvent $e){ if(in_array($e->getPlayer()->getName(), $this->ban)){ $this->getServer()->getNameBans()->addBan($e->getPlayer()->getName()); } }