Command not working

Hello, im new to coding and have been doing alot to learn it.  still have a long way to go.  been getting the hand of it finally at least i think XD.  been having issue with just a simple test command i was messing with to learn it.  run the command and nothing happens.  tried alot of different ways of sending them and checking permissions, ect.  iv first tried whats on the docs here then tried what iv seen on youtube. 

        [ChatCommand("test")]
        void TestCommand(IPlayer player, string command, string[] args)
        {
            string Id = player.Id;
            string name = player.Name;

            Server.Broadcast(Id + name + "E this is a test");
            if (permission.UserHasPermission(Id, "TheGdog.adminlist"))
            {

                Server.Broadcast(name + "is online");

            }
            else
            {
                Server.Broadcast(name + "you do not have permission");
            }
        }​

no errors in console, ect

so if anyone finds this in the future or still want to give pointers, ect.  i found a fix. 

 [ChatCommand("test")]
        void TestCommand(BasePlayer player, string command, string[] args)
        {
            TCommand(player, command, args);
        }
        void TCommand(BasePlayer player, string command, string[] args)
        {
            if (permission.UserHasPermission(player.IPlayer.Id, "TheGdog.adminlist"))
            {

                PrintToChat(player.IPlayer.Name + " is online");
                Server.Broadcast(player.IPlayer.Name + " is online");
            }
            else
            {
                PrintToChat("you do not have permission");
            }
        }​

this somehow works.  XD

In the first code, you must decide based on if you are using RustPlugin or CovalencePlugin

For RustPlugin to execute command you have to:

[ChatCommand("test")]
        void TestCommand(BasePlayer player, string command, string[] args)
        {
            string Id = player.UserIDString;
            string name = player.name;

            Server.Broadcast(Id + name + "E this is a test");
            if (permission.UserHasPermission(Id, "TheGdog.adminlist"))
            {

                Server.Broadcast(name + "is online");

            }
            else
            {
                Server.Broadcast(name + "you do not have permission");
            }
        }


For CovalencePlugin:

[Command("test")]
        void TestCommand(IPlayer player, string command, string[] args)
        {
            string Id = player.Id;
            string name = player.Name;

            Server.Broadcast(Id + name + "E this is a test");
            if (permission.UserHasPermission(Id, "TheGdog.adminlist"))
            {

                Server.Broadcast(name + "is online");

            }
            else
            {
                Server.Broadcast(name + "you do not have permission");
            }
        }

hey, so where can i find the docs/info for baseplayer and IPlayer?  would i need to decompile a reference or is there something online for it?  

thegdog

hey, so where can i find the docs/info for baseplayer and IPlayer?  would i need to decompile a reference or is there something online for it?  

I'm personally learning from other projects etc..

But when I just looked up, found IPlayer when you decompile Oxide.Core.dll

I mean you can always use dnSpy and the search bar... :D

yeah true,  i also jsut use the object viewer right in VS