Commands do not work from console
Hey,
Love the plugin...
However a quite dealbreaking bug is that the commands do not work in console.
I reviewed the source and see that it has an if statement 
if (!HasPerm(player.Id, "admin"))​

This permission check seems to be applicable to console commands too, and obviously console cannot have any permissions like a player.

Pls fix :D
The server console (and RCON) automatically has all permissions. The F1 console on clients would be the same as via the chat.
In response to Wulf ():
The server console (and RCON) automatically has all permissions. The F1 console on clients would be...
Yeah, I know that. I thought it would help me out of this situation.
But somehow the way the plugin is written it ends up in the "else" block where it would because it cannot look up the player.ID of a console command, am I right?

This should give more context
[Command("strike")]
        void cmdStrike(IPlayer player, string cmd, string[] args)
        {
            if(args.Length == 0)
            {
                if (HasPerm(player.Id, "admin"))
                    player.Reply("<color=#C4FF00>/strike <player> [reason]</color> strike player" + Environment.NewLine +
                                            "<color=#C4FF00>/strike reset <player> [only Active Strikes: true/false]</color> reset players strikes" + Environment.NewLine +
                                            "<color=#C4FF00>/strike remove <player> [amount] [only Active Strikes: true/false]</color> remove strikes of a player " + Environment.NewLine +
                                            "<color=#C4FF00>/strike info [player]</color> get strike info about a player" + Environment.NewLine +
                                            "<color=#C4FF00>/strike wipe [only Active Strikes: true/false]</color> wipe all strikes" + Environment.NewLine +
                                            "<color=#C4FF00>/strike wipefull</color> wipe all data");
                else
                    player.Reply("<color=#C4FF00>/strike info</color> get your strike info");

                return;
            }​
In response to FakeNinja ():
Yeah, I know that. I thought it would help me out of this situation.
But somehow the way the pl...
Which console are you trying to use it from exactly? The console player still has an ID and always has permission from Oxide.
In response to Wulf ():
Which console are you trying to use it from exactly? The console player still has an ID and always h...
RustAdmin RCON, or WebRCON in general.
In response to FakeNinja ():
RustAdmin RCON, or WebRCON in general.
Okay, so it looks like the check used didn't automatically allow admin, but it can be switched to a more appropriate method that would allow it. I've also made sure that the "server_console" ID is always allowed in the next Oxide.Core version for the method that this plugin is using.
In response to Wulf ():
Okay, so it looks like the check used didn't automatically allow admin, but it can be switched to a...
Great! I'm happy to contribute with some kind of improvement.
I suppose I can resolve it temporarily by creating a seperate ConsoleCommand and pushing the arguments to the ChatCommand methods? I'm somewhat shitty at C# but the theory passes in my head.
In response to FakeNinja ():
Great! I'm happy to contribute with some kind of improvement.
I suppose I can resolve it tempor...
You can just add a check to see if the ID is "server_console" or not in the HasPerm method.
In response to Wulf ():
You can just add a check to see if the ID is "server_console" or not in the HasPerm method.
Like this?
if (HasPerm("server_console","admin"))​
In response to FakeNinja ():
Like this?
if (HasPerm("server_console","admin"))​
No, inside of the HasPerm method at the bottom of the plugin.
if (uid.ToString().Equals("server_console")) return true;​
can it be added so we can strike via console? Thanks
In response to Badger ():
can it be added so we can strike via console? Thanks
Thread merged. Please see the above replies.