Hi, In the plugin TimeRanks, something is missing. https://github.com/luca28pet/TimeRanks The thing which is missing is the command /tr check {player} too seee how much time a player is playing. Can someone add it on please P.S, if you do please tell me how I am trying to learn to code (dont have too)! Thanks!
It stores playtime in seconds, so you have to convert them into hours, minutes, then seconds... here is a link that show exactly how to do it, after converting, you can easily see playtime in hours, minutes and seconds
Time ranks plugin 'store' play time in 'seconds', so you have to convert those 'seconds' to get exact play time of a player, example: Az528: 12Hours, 19Minutes, 55Seconds
Yes, I understand that but doesnt the plugin have a command called /tr? I know this because on EndernationPE it has /tr check (player), to see how long he played. But on the github it has nothing mentioning with the command. My friend sent me this code does it help anywehre..? https://pastebin.com/3xad1KEc
PHP: <?phpnamespace TimeRanks;use pocketmine\command\CommandSender;use pocketmine\Player;class TimeRanksCommand{ public function __construct(Main $plugin){ $this->plugin = $plugin; } public function run(CommandSender $sender, array $args){ if(!isset($args[0])){ $sender->sendMessage ("§e-= §bCastleRaid §aTimeRanks plugin §e=-"); $sender->sendMessage("§e-= §aTimeRanks plugin by §cluca28pet §e=-"); $sender->sendMessage("§aUse /tr check [player]"); return true; } $sub = array_shift($args); switch(strtolower($sub)){ case "check":A if(isset($args[0])){ if(!$this->plugin->getServer()->getOfflinePlayer($args[0])->hasPlayedBefore()){ $sender->sendMessage("§5Player§a ".$args[0]." §5never played on §aCastleRaid"); return true; } if(!$this->plugin->data->exists(strtolower($args[0]))){ $sender->sendMessage($args[0]." §5has played less than 1 minute on §aCastleRaid"); $sender->sendMessage("§5Rank is:§a ".$this->plugin->default); return true; } $sender->sendMessage($args[0]." §5has played§a ".$this->plugin->data->get(strtolower($args[0]))." §5minutes on §aCastleRaid"); $sender->sendMessage("§5Rank is:§a ".$this->plugin->getRank(strtolower($args[0]))); return true; } if(!$this->plugin->data->exists(strtolower($sender->getName()))){ if(!($sender instanceof Player)){ $sender->sendMessage("§ePlease use §a/tr check <playername>"); return true; } $sender->sendMessage("§5You have played less than 1 minute on §aCastleRaid"); $sender->sendMessage("§5Rank is:§a ".$this->plugin->default); return true; } $sender->sendMessage("§5You have played§a ".$this->plugin->data->get(strtolower($sender->getName()))." §5minutes on §aCastleRaid"); $sender->sendMessage("§5Rank is:§a ".$this->plugin->getRank(strtolower($sender->getName()))); return true; break; default: return false; } }} Are you sure, works for me welp anyways ill paste it here as well..