-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRageQuit.php
More file actions
43 lines (37 loc) · 1.09 KB
/
RageQuit.php
File metadata and controls
43 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
__Pocketmine Plugin__
name=RageQuit
version=0.2.2
author=ZacHack
class=Rage
apiversion=9, 10
*/
class Rage implements Plugin{
private $api, $config;
public function __construct(ServerAPI $api, $server = false){
$this->api = $api;
}
public function init(){
$this->config = new Config($this->api->plugin->configPath($this)."config.yml", CONFIG_YAML, array(
"RageQuit text" => "<Custom Text Here>",
"Action Text" => "<Custom Text here>",
));
$this->rage = $this->config->get("RageQuit text");
$this->action = $this->config->get("Action Text");
$this->api->addHandler("player.quit", array($this, "handle"), 15);
$this->api->console->register("ragequit", "<reload>", array($this, "reload"));
$this->api->console->alias("rq", "ragequit");
}
public function __destruct(){
}
public function handle($data, $event){
$user = $data->username;
switch($event){
case "player.quit";
$this->api->chat->broadcast(" ".$this->rage." ");
$this->api->chat->broadcast(" ".$user." ".$this->action." ");
break;
}
}
}