HotBar 1.1.5-1.1.7

Приветствую, сегодня сливаю годный хотбар (хз как оно вам, но мне зашло). В нем есть коорды, пинг, привелегия, экономика, кд, ник, клан, вобщем-то классический хотбар.

Hotbar.zip (1,9 КБ)

Удачи в использовании! (без критики пж, я начинающий)

<?php

namespace hotbar;

use pocketmine\event\Listener;
use pocketmine\plugin\PluginBase;
use pocketmine\Server;
use pocketmine\scheduler\CallbackTask;
use pocketmine\Player;

class Main extends PluginBase implements Listener {
      public function onEnable() {
 		$this->getServer()->getPluginManager()->registerEvents($this, $this);
 		$this->Factions = $this->getServer()->getPluginManager()->getPlugin('Clans');
	$this->EconomyAPI = $this->getServer()->getPluginManager()->getPlugin("EconomyAPI");
   $this->PurePerms = $this->getServer()->getPluginManager()->getPlugin('PurePerms');
   $this->KillChat = $this->getServer()->getPluginManager()->getPlugin('KillChat');

      $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this, "hotbar")),  10);
 	}
 		
	function getFactions(){
		return $this->Factions;
	}
	
	function getFaction(Player $player){
		$name = strtolower($player->getName());
		if($this->getFactions() !== null){
			$cname = $this->getFactions();
			$clan = $cname->getPlayerClan($name);
			return $clan !== null ? $clan : $this->getConfig()->get("ClanNone", "x");
		}
		return $this->getConfig()->get("ClanNone", "x");
	}
 	
 	function hotbar(){
		$onl = count($this->getServer()->getOnlinePlayers());
		$maxonl = $this->getServer()->getMaxPlayers();
		foreach($this->getServer()->getOnlinePlayers() as $p) {
  $ping = $p->getPing();
		
		$name = $p->getName();
      if ($this->PurePerms){
					$ppg = $a = $this->PurePerms->getUserDataMgr()->getData($p)['group'];
    	 	}else{
					$ppg = "§cПлагин жоқ";
    	 	}	
      if ($this->KillChat) {
					$kill = $this->KillChat->getKills($name);
					$death = $this->KillChat->getDeaths($name);
				} else {
					$kill = $death =  "§cПлагин жоқ";
				}
				if ($this->Factions) {
					$clan = $this->getFaction($p);
					
	 	} else $clan = '§cПлагин жоқ';

	   if ($this->EconomyAPI){
		           $cash = $this->EconomyAPI->myMoney($name);
		  }else{
					  $cash = "§cПлагин жоқ";
		  }
		  $time = strtotime('+3 hours', time());
          $date = date('d/m/Y H:i:s', $time);
          $x = $p->getFloorX();
          $y = $p->getFloorY();
          $z = $p->getFloorZ();
				$t = str_repeat(" ", 75);
           $p->sendTip($t."§aHine§fMine - §c§lГриф§r§7 [{$ping}]\n".$t."§a╔ §fНикнейм§f:§a {$name}§6 \n".$t."§2╚ §fПривелегия§f:§a {$ppg}§6 \n\n".$t."§a╔§f Клан: §a{$clan}§e \n".$t."§2╚ §fМонеты: §a{$cash}§e \n\n".$t."§a╔ §fУ/С§f:§a {$kill}/{$death}§e \n".$t."§2╚ §fХайн-Койны: §asoon...\n\n".$t."§a╔ §fОнлайн: §a{$onl}§f/§c{$maxonl} \n".$t."§2╚ §fXYZ: §7[§a{$x}§7] [§2{$y}§7] [§a{$z}§7] \n".str_repeat("\n", 11));
 	}
}
}