Skip to content

Commit

Permalink
Version 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavius12 committed Dec 29, 2014
1 parent 2fec722 commit a4415fa
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/ServerKits/Commands/Commands.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/*
* KitPro (v1.1) by EvolSoft
* ServerKits (v1.2) by EvolSoft
* Developer: EvolSoft (Flavius12)
* Website: http://www.evolsoft.tk
* Date: 27/12/2014 04:00 PM (UTC)
* Date: 29/12/2014 09:45 AM (UTC)
* Copyright & License: (C) 2014 EvolSoft
* Licensed under MIT (https://github.com/EvolSoft/KitPro/blob/master/LICENSE)
* Licensed under MIT (https://github.com/EvolSoft/ServerKits/blob/master/LICENSE)
*/

namespace KitPro\Commands;
namespace ServerKits\Commands;

use pocketmine\plugin\PluginBase;
use pocketmine\permission\Permission;
Expand All @@ -19,8 +19,8 @@
use pocketmine\Player;
use pocketmine\utils\TextFormat;

use KitPro\Main;
use KitPro\EventListener;
use ServerKits\Main;
use ServerKits\EventListener;

class Commands extends PluginBase implements CommandExecutor{

Expand All @@ -31,32 +31,32 @@ public function __construct(Main $plugin){
public function onCommand(CommandSender $sender, Command $cmd, $label, array $args) {
$fcmd = strtolower($cmd->getName());
switch($fcmd){
case "kitpro":
case "serverkits":
if(isset($args[0])){
$args[0] = strtolower($args[0]);
if($args[0]=="help"){
if($sender->hasPermission("kitpro.commands.help")){
if($sender->hasPermission("serverkits.commands.help")){
$sender->sendMessage($this->plugin->translateColors("&", "&7<<>> &cAvailable Commands &7<<>>"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kitpro info &7<>&a Show info about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kitpro help &7<>&a Show help about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kitpro reload &7<>&a Reload the config"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/serverkits info &7<>&a Show info about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/serverkits help &7<>&a Show help about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/serverkits reload &7<>&a Reload the config"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kit &7<>&a Get a kit"));
break;
}else{
$sender->sendMessage($this->plugin->translateColors("&", "&cYou don't have permissions to use this command"));
break;
}
}elseif($args[0]=="info"){
if($sender->hasPermission("kitpro.commands.info")){
$sender->sendMessage($this->plugin->translateColors("&", Main::PREFIX . "&7KitPro &av" . Main::VERSION . " &7developed by&a " . Main::PRODUCER));
if($sender->hasPermission("serverkits.commands.info")){
$sender->sendMessage($this->plugin->translateColors("&", Main::PREFIX . "&7ServerKits &av" . Main::VERSION . " &7developed by&a " . Main::PRODUCER));
$sender->sendMessage($this->plugin->translateColors("&", Main::PREFIX . "&7Website &a" . Main::MAIN_WEBSITE));
break;
}else{
$sender->sendMessage($this->plugin->translateColors("&", "&cYou don't have permissions to use this command"));
break;
}
}elseif($args[0]=="reload"){
if($sender->hasPermission("kitpro.commands.reload")){
if($sender->hasPermission("serverkits.commands.reload")){
$this->plugin->reloadConfig();
$sender->sendMessage($this->plugin->translateColors("&", Main::PREFIX . "&aConfiguration Reloaded."));
break;
Expand All @@ -65,20 +65,20 @@ public function onCommand(CommandSender $sender, Command $cmd, $label, array $ar
break;
}
}else{
if($sender->hasPermission("kitpro")){
$sender->sendMessage($this->plugin->translateColors("&", Main::PREFIX . "&cSubcommand &a" . $args[0] . " &cnot found. Use &a/kitpro help &cto show available commands"));
if($sender->hasPermission("serverkits")){
$sender->sendMessage($this->plugin->translateColors("&", Main::PREFIX . "&cSubcommand &a" . $args[0] . " &cnot found. Use &a/serverkits help &cto show available commands"));
break;
}else{
$sender->sendMessage($this->plugin->translateColors("&", "&cYou don't have permissions to use this command"));
break;
}
}
}else{
if($sender->hasPermission("kitpro.commands.help")){
if($sender->hasPermission("serverkits.commands.help")){
$sender->sendMessage($this->plugin->translateColors("&", "&7<<>> &cAvailable Commands &7<<>>"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kitpro info &7<>&a Show info about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kitpro help &7<>&a Show help about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kitpro reload &7<>&a Reload the config"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/serverkits info &7<>&a Show info about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/serverkits help &7<>&a Show help about this plugin"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/serverkits reload &7<>&a Reload the config"));
$sender->sendMessage($this->plugin->translateColors("&", "&c/kit &7<>&a Get a kit"));
break;
}else{
Expand Down

0 comments on commit a4415fa

Please sign in to comment.