I need help for a plugin, that when you have 3 warnings you will be banned for 2 hours this is the help code please if($cmd->getName() == "wa"){ if($player->hasPermission("spe.staff")){ $sv = "§8[§bSP§eE§8]§r "; 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); $warn = new Config($this->getDataFolder()."/warn.yml",Config::YAML); $w = $warn->get($jug->getName()); $warn->set($jug->getName(), $w + 1); $warn->save(); $wa = $warn->get($jug->getName()); $jug->sendMessage("§l§o§eYou Have ".$wa." §ewarnings"); $jug->sendMessage("§l§o§eYou have been warning for§c ".$motivo."§e, be careful"); $player->sendMessage("§l§o§eThe player§c ".$jug->getName()."§e was warned by§c ". $motivo); $jug->addTitle("§c§o§lWarning", "§e§l§oWarning for ".$player->getName(),20, 40, 20); $jug->getInventory()->clearAll(); $jug->teleport($this->getServer()->getDefaultLevel()->getSafeSpawn()); $jug->setGamemode(0); $jug->setFood(20); $jug->setHealth(20); }}}
Exactly. What is your querie anyway? This is a non-informative thread description, you are not explaining the problem in question, unless someone (even) bothers in looking at your code without knowing what is wrong with it, or what do you want to do with it.
Please help them too if you want to comment on this just gonna add some some unhelpful "USE PHP" comment Instated of supporting him, why not help OP out? if you really want the php format just do a post and boom there u go See it's easy: PHP: if($cmd->getName() == "wa"){if($player->hasPermission("spe.staff")){$sv = "§8[§bSP§eE§8]§r ";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);$warn = new Config($this->getDataFolder()."/warn.yml",Config::YAML);$w = $warn->get($jug->getName());$warn->set($jug->getName(), $w + 1);$warn->save();$wa = $warn->get($jug->getName());$jug->sendMessage("§l§o§eYou Have ".$wa." §ewarnings");$jug->sendMessage("§l§o§eYou have been warning for§c ".$motivo."§e, be careful");$player->sendMessage("§l§o§eThe player§c ".$jug->getName()."§e was warned by§c ". $motivo);$jug->addTitle("§c§o§lWarning", "§e§l§oWarning for ".$player->getName(),20, 40, 20);$jug->getInventory()->clearAll();$jug->teleport($this->getServer()->getDefaultLevel()->getSafeSpawn());$jug->setGamemode(0);$jug->setFood(20);$jug->setHealth(20);}}}