diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index 272439ec4..788d6bbd1 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -196,9 +196,6 @@ class PlayerAPI{ "spectator" => VIEW, "v" => VIEW, ); - if($issuer instanceof Player){ - $player = $issuer; - } if(isset($params[1])){ if($this->server->api->player->get($params[1]) instanceof Player){ $player = $this->server->api->player->get($params[1]); @@ -210,7 +207,15 @@ class PlayerAPI{ $output .= "Usage: /$cmd [player] or /$cmd [player] \n"; break; } + }elseif(isset($params[0])){ + if(!($this->server->api->player->get($params[0]) instanceof Player)){ + if($issuer instanceof Player){ + $setgm = $params[0]; + $player = $issuer; + } + } } + if(!($player instanceof Player) or !isset($gms[strtolower($setgm)])){ $output .= "Usage: /$cmd [player] or /$cmd [player] \n"; break;