Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Vaivez66\NoAdvertisingPE;
  4.  
  5. use pocketmine\Server;
  6. use pocketmine\plugin\PluginBase;
  7. use pocketmine\Player;
  8. use pocketmine\command\Command;
  9. use pocketmine\command\CommandSender;
  10. use pocketmine\command\CommandExecutor;
  11. use pocketmine\utils\TextFormat as TF;
  12.  
  13. class NoAdvertisingCommand extends PluginBase {
  14.  
  15. public function __construct(NoAdvertising $plugin){
  16. $this->plugin = $plugin;
  17. }
  18.  
  19. public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){
  20. switch(strtolower($cmd->getName())){
  21. case "na":
  22. if($sender->hasPermission("no.advertising.pe")) {
  23. if (isset($args[0])) {
  24. switch ($args[0]) {
  25. case "add":
  26. if(isset($args[1])){
  27. return $this->plugin->addDomain($sender, $args[1]);
  28. }
  29. else{
  30. return false;
  31. }
  32. break;
  33. case "remove":
  34. if(isset($args[1])){
  35. return $this->plugin->removeDomain($sender, $args[1]);
  36. }
  37. else{
  38. return false;
  39. }
  40. break;
  41. case "list":
  42. return $this->plugin->listDomain($sender);
  43. break;
  44. }
  45. }
  46. else{
  47. return false;
  48. }
  49. }
  50. else{
  51. $sender->sendMessage(TF::RED . "You do not have permission");
  52. return true;
  53. }
  54. break;
  55. }
  56. }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement