PHP - plugin para minecraftpe - como poner 2 ranks en un mismo jugador

   
Vista:

plugin para minecraftpe - como poner 2 ranks en un mismo jugador

Publicado por MonkeyCortu spokype@gmail.com (1 intervención) el 09/01/2018 02:24:59
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
 
namespace SPERanks;
 
use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\utils\Config;
use pocketmine\utils\TextFormat as C;
 
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
 
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\player\PlayerChatEvent;
use pocketmine\event\player\PlayerRespawnEvent;
use pocketmine\event\player\PlayerDeathEvent;
 
class SPERanks extends PluginBase implements Listener{
 
public $KB = [];
public $gokus = [];
private $attachments = [];
 
 public function onEnable(){
  $this->getLogger()->info(C::GREEN . "SPE-Ranks activated");
  $this->getServer()->getPluginManager()->registerEvents($this, $this);
  @mkdir($this->getDataFolder());
 
  $rankyml = new Config($this->getDataFolder() . "/rank.yml", Config::YAML);
  $rankyml->save();
 
  $ytrankyml = new Config($this->getDataFolder() . "/rank.yml", Config::YAML);
  $ytrankyml->save();
}
 
 public function onQuit(PlayerQuitEvent $e){
   $player = $e->getPlayer();
   $e->setQuitMessage("");
  }
 
public function onChat(PlayerChatEvent $event){
  $player = $event->getPlayer();
  $message = $event->getMessage();
  $rankyml = new Config($this->getDataFolder() . "/rank.yml", Config::YAML);
  $rank = $rankyml->get($player->getName());
  $ytrankyml = new Config($this->getDataFolder() . "/ytrank.yml", Config::YAML);
  $ytrank = $ytrankyml->get($player->getName());
  $event->setFormat(C::RESET ."§8[User]". $player->getName() . C::GRAY ." §7: §7". $message);
 
}
 
public function onCommand(CommandSender $player, Command $cmd, $label, array $args) {
 
switch($cmd->getName()){
 
case "setrank":
  if($player->hasPermission("spe.rank")){
    if (isset($args[0])) {
        $jug = $player->getServer()->getPlayer($args[0]);
        if($jug!=null){
if(isset($args[1])){
$motivo = implode(" ", $args);
$worte = explode(" ", $motivo);
unset($worte[0]);
$motivo = implode(" ", $worte);
$rankyml = new Config($this->getDataFolder()."/rank.yml",Config::YAML);
$rankyml->set($jug->getName(), $motivo);
$rankyml->save();
$this->strank($jug);
$player->sendMessage("§7Se dio a:§b ". $jug->getName(). " §7el rango:§b $motivo ");
$player->sendMessage("§l§cNotice §f» §r§eRangos Disponibles: §6SkyHero, Owner, Admin, Mod, Helper, YouTuber, Dev, F");
}}}}
break;
 
case "setytrank":
if($player->hasPermission("spe.rank")){
  if (isset($args[0])) {
      $jug = $player->getServer()->getPlayer($args[0]);
      if($jug!=null){
if(isset($args[1])){
$motivo = implode(" ", $args);
$worte = explode(" ", $motivo);
unset($worte[0]);
$motivo = implode(" ", $worte);
$ytrankyml = new Config($this->getDataFolder()."/ytrank.yml",Config::YAML);
$ytrankyml->set($jug->getName(), $motivo);
$ytrankyml->save();
$player->sendMessage("§7Se dio a:§b ". $jug->getName(). " §7el rango:§b $motivo ");
$player->sendMessage("§l§cNotice §f» §r§eRangos Disponibles: §6SkyHero, Owner, Admin, Mod, Helper, YouTuber, Dev, F");
}}}}
break;
}
}
 
public function strank($player){
  if(isset($this->KB[$player->getName()])){
      unset ($this->KB[$player->getName()]);
  }
  if(isset($this->gokus[$player->getName()])){
  $player->setAllowFlight(false);
  unset ($this->gokus[$player->getName()]);
  }
  $rankyml = new Config($this->getDataFolder()."/rank.yml",Config::YAML);
  $srank = $rankyml->get($player->getName());
 
  if($srank == "Owner"){
      $player->setName("§8[§b".$srank."§8]§3".$player->getName());
  }
  elseif($srank == "Admin"){
      $player->setName($r." §3".$player->getName());
  }
}
 
}


Quisiera ver si me podrian ayudar con eso es de un plugin para minecraftpe y quiero saber como poner 2 ranks en un mismo jugador espero y me puedan ayudar :D
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder