-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathReport.php
More file actions
40 lines (36 loc) · 1.09 KB
/
Report.php
File metadata and controls
40 lines (36 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
<?php
/*
__PocketMine Plugin__
name=Report
version=1.0.2
author=ZacHack
class=Report
apiversion=10
*/
class Report implements Plugin{
private $api, $message, $player;
public function __construct(ServerAPI $api, $server = false){
$this->api = $api;
$this->server = ServerAPI::request();
}
public function init(){
$this->config = new Config($this->api->plugin->configPath($this)."Reports.yml", CONFIG_YAML, array(
"Reports" => array(),
));
$this->api->console->register("report", "Report a player for the owner", array($this, "cmd"));
$this->config = $this->api->plugin->readYAML($this->api->plugin->configPath($this) ."Reports.yml");
$this->server->api->ban->cmdWhitelist("report");
}
public function cmd($cmd, $args, $issuer, $params){
switch($cmd){
case "report":
$name = $issuer->username;
$msg = implode(" ", $args);
$this->config['Reports'][] = array($name, $msg);
$output = "You have made a report";
$this->api->plugin->writeYAML($this->api->plugin->configPath($this) ."Reports.yml", $this->config);
}
return $output;
}
public function __destruct(){}
}