Exemple #1
0
        public string[] OnCall(ICommandSender sender, string[] args)
        {
            if (sender is Player player)
            {
                if (!player.HasPermission("vpnshield.whitelist"))
                {
                    return(new[] { "You don't have permission to use that command." });
                }
            }

            if (args.Length > 0)
            {
                if (plugin.whitelist.Contains(args[0]))
                {
                    plugin.whitelist.Remove(args[0]);
                    plugin.SaveWhitelistToFile();
                    return(new[] { "Player removed from whitelist." });
                }
                else
                {
                    plugin.whitelist.Add(args[0]);
                    plugin.SaveWhitelistToFile();
                    return(new[] { "Player added to whitelist." });
                }
            }
            return(new[] { "Invalid arguments, usage: \"" + GetUsage() + "\"" });
        }
Exemple #2
0
 public string[] OnCall(ICommandSender sender, string[] args)
 {
     if (args.Length > 0)
     {
         if (plugin.whitelist.Contains(args[0]))
         {
             plugin.whitelist.Remove(args[0]);
             plugin.SaveWhitelistToFile();
             return(new string[] { "Player removed from whitelist." });
         }
         else
         {
             plugin.whitelist.Add(args[0]);
             plugin.SaveWhitelistToFile();
             return(new string[] { "Player added to whitelist." });
         }
     }
     return(new string[] { "Invalid arguments, usage: \"" + GetUsage() + "\"" });
 }