Skip to content

Instantly share code, notes, and snippets.

@PEMapModder
Last active December 30, 2015 05:35
Show Gist options
  • Save PEMapModder/48098c1348f3c38b97e9 to your computer and use it in GitHub Desktop.
Save PEMapModder/48098c1348f3c38b97e9 to your computer and use it in GitHub Desktop.
<?php
/**
* @name ServerKiller
* @author PEMapModder
* @version 2.0.0
* @api 2.0.0
* @main ServerKiller\ServerKiller
*/
namespace ServerKiller;
class ServerKiller extends \pocketmine\plugin\PluginBase{
public function onEnable(){
$this->getServer()->getScheduler()->scheduleDelayedTask(new KillerTask($this), 2);
}
}
class KillerTask extends \pocketmine\scheduler\PluginTask{
public function onRun($t){
$this->owner->getLogger()->info("Shutting down server...");
$this->owner->getServer()->shutdown();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment