Hello, I have this code from a friend plugin which I'm trying to edit into a party plugin PHP: public function onCommand(CommandSender $sender, Command $command, $label, array $args) : bool{ switch($command->getName()){ case "friend": if ($sender instanceof Player){ if (isset($args[0])){ switch ($args[0]){ case "add": if (isset($args[1])){ $player = $this->getServer()->getPlayer($args[1]); if(!$player == null){ $this->addRequest($player, $sender); } else { $sender->sendMessage("§c" . $args[1] . " §cis not online"); } }else{ $sender->sendMessage("§eUsage: /friend add [name]"); } break; case "remove": if (isset($args[1])){ if ($this->removeFriend($sender, $args[1])){ $sender->sendMessage("§c" . $args[1] . " §cremoved as your friend"); }else{ $sender->sendMessage("§cFriend not found do /friend list to list your friends"); } }else{ $sender->sendMessage("§eUsage: /friend remove [name]"); } break; case "list": $config = new Config($this->getDataFolder()."players/". strtolower($sender->getName()).".yml", Config::YAML); $array = $config->get("friends", []); $sender->sendMessage(TextFormat::GOLD.TextFormat::BOLD."Friends:"); foreach ($array as $friendname){ $sender->sendMessage(TextFormat::GREEN."* ".$friendname); } break; } }}else{ $sender->sendMessage("Must use command in-game"); } break; case "accept": //echo var_dump($this->request); if (in_array($sender->getName(), $this->request)){ //echo "added"; foreach ($this->request as $target => $requestp){ $target = $this->getServer()->getPlayer($target); $requestp = $this->getServer()->getPlayer($requestp); echo $target->getName().$requestp->getName(); if ($requestp->getName() === $sender->getName()){ //echo "yes"; $this->addFriend($target, $requestp); $this->addFriend($requestp, $target); } } }else{ $sender->sendMessage("§cNo pending friend requests"); } } return true; } What I'm trying to do is add a usage message such as $sender->sendMessage("showing friend commands") when the player types /friend I don't know where it goes :/ help
PHP: }}else{$sender->(no pending) Should be changed to PHP: }else{ $sender->sendMessage(“Showing friend commands”);}else{... (no pending)