-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgetc.php
44 lines (39 loc) · 954 Bytes
/
getc.php
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
44
<?php
/*
__PocketMine Plugin__
name=GetC
description=GetC
version=0.5
author=WreWolf
class=GetC
apiversion=9
*/
class GetC implements Plugin
{
private $api;
public function __construct(ServerAPI $api, $server = false)
{
$this->api = $api;
}
public function init()
{
$this->api->console->register("getc", "/getc Get user coordinate", array($this, "commandH"));
$this->api->ban->cmdWhitelist("getc");
}
public function __destruct()
{
}
public function commandH($cmd, $params, $issuer, $alias)
{
$output = "";
if ($issuer instanceof Player) {
$x = round($issuer->entity->x - 0.5);
$y = round($issuer->entity->y);
$z = round($issuer->entity->z - 0.5);
$output .= "Player position (" . $x . ", " . $y . ", " . $z . ")\n";
} else {
$output .= "Please run this command on the game.\n";
}
return $output;
}
}