From c38e77e33db2b065ec04c70094606d50b21e3afb Mon Sep 17 00:00:00 2001 From: Pogogo007 Date: Wed, 19 Oct 2016 08:21:07 -0400 Subject: [PATCH 1/3] Update Main.php --- CombatLogger/src/Lambo/CombatLogger/Main.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CombatLogger/src/Lambo/CombatLogger/Main.php b/CombatLogger/src/Lambo/CombatLogger/Main.php index f33892f..220e4b9 100644 --- a/CombatLogger/src/Lambo/CombatLogger/Main.php +++ b/CombatLogger/src/Lambo/CombatLogger/Main.php @@ -20,6 +20,7 @@ class Main extends PluginBase implements Listener{ private $players = array(); public $tasks = array(); public $interval = 10; + public $isrestarting = []; public function onEnable(){ $this->saveDefaultConfig(); From 4d4016a9ca58e03eed555e2a0233d062881fe2f4 Mon Sep 17 00:00:00 2001 From: Pogogo007 Date: Wed, 19 Oct 2016 09:03:56 -0400 Subject: [PATCH 2/3] Update Main.php --- CombatLogger/src/Lambo/CombatLogger/Main.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CombatLogger/src/Lambo/CombatLogger/Main.php b/CombatLogger/src/Lambo/CombatLogger/Main.php index 220e4b9..d5906b7 100644 --- a/CombatLogger/src/Lambo/CombatLogger/Main.php +++ b/CombatLogger/src/Lambo/CombatLogger/Main.php @@ -14,13 +14,13 @@ use pocketmine\event\player\PlayerDeathEvent; use pocketmine\event\player\PlayerQuitEvent; use pocketmine\scheduler\PluginTask; +use pocketmine\event\player\PlayerKickEvent; class Main extends PluginBase implements Listener{ private $players = array(); public $tasks = array(); public $interval = 10; - public $isrestarting = []; public function onEnable(){ $this->saveDefaultConfig(); @@ -79,6 +79,11 @@ public function PlayerDeathEvent(PlayerDeathEvent $event){ } } + public function onKick(PlayerKickEvent $event){ + if(isset($this->players[$event->getPlayer()->getName()])){ + unset($this->players[$event->getPlayer()->getName()]); + } + /** * @param PlayerQuitEvent $event * From edb6c37cea27c69f2709d3dd938825ffdf2975c0 Mon Sep 17 00:00:00 2001 From: Pogogo007 Date: Wed, 19 Oct 2016 09:05:01 -0400 Subject: [PATCH 3/3] Update Main.php --- CombatLogger/src/Lambo/CombatLogger/Main.php | 1 + 1 file changed, 1 insertion(+) diff --git a/CombatLogger/src/Lambo/CombatLogger/Main.php b/CombatLogger/src/Lambo/CombatLogger/Main.php index d5906b7..7ce2794 100644 --- a/CombatLogger/src/Lambo/CombatLogger/Main.php +++ b/CombatLogger/src/Lambo/CombatLogger/Main.php @@ -82,6 +82,7 @@ public function PlayerDeathEvent(PlayerDeathEvent $event){ public function onKick(PlayerKickEvent $event){ if(isset($this->players[$event->getPlayer()->getName()])){ unset($this->players[$event->getPlayer()->getName()]); + if(isset($this->tasks[$event->getEntity()->getName()])) $this->getServer()->getScheduler()->cancelTask($this->tasks[$event->getEntity()->getName()]);unset($this->tasks[$event->getEntity()->getName()]); } /**