Running line of code on console commandSolved

Hello community,

I am currently trying to develop my first Rust plugin. Sofar I have almost everything in order except one thing. I want to be able to type a command in chat which resets a certain item, it is currently looking like this:

#region commands

[ConsoleCommand("MyPlugin.reset")]
	void MyPluginCommand(ConsoleSystem.Arg arg)
	{
		covalence.Server.Command("Say The items have been reset!");
                puts("Items have been reset!")
        }
#endregion commands

Does anyone know where it went wrong?

There are a few things wrong there, but what exactly is the issue you are questioning?
Thanks for the quick answer!

I want to be able to run a command in the rust console, whenever the command is ran it should run: 
covalence.Server.Command("Say The items have been reset!");​

or whatever is between those brackets.
In response to YpDutch ():
Thanks for the quick answer!

I want to be able to run a command in the rust console, when...
Okay, and what is the issue with that? Are you receiving an error? Does it not do what you want?
No it doesn't do anything at all
In response to YpDutch ():
No it doesn't do anything at all
As it stands, the code your showed in the first post won't compile, which you can see that in your server console or oxide/logs. To start with, "puts" doesn't exist, "Puts" does; this is one reason it won't compile.

The above code does work and writes in console
In response to YpDutch ():

The above code does work and writes in console
That'd be a miracle then, because we provide no method named "puts", only "Puts". If you can provide what you currently have that you say works, we can go from there.
using System.Collections.Generic;
using Oxide.Core.Libraries.Covalence;

namespace Oxide.Plugins
{
    [Info("NoobZombieIgnore", "YpDutch", "0.1.1", ResourceId = 0)]
	[Description("Sends a message when players joins server for the first time and puts them in a noob group")]
    public class NoobZombie : CovalencePlugin
    {
        private const string permReturning = "Noobs.Return";
		private const string FirstJoinGroup = "NoobsGroup";
		private const string ReturningGroup = "ReturningPlayers";
		

        private void Init()
        {
            permission.RegisterPermission(permReturning, this);
            lang.RegisterMessages(new Dictionary<string, string>
            {
                ["First Time Message"] = "{0} is a new player, welcome to the server!"
            }, this);
        }
		
		private void Loaded()
		{
			Puts("Loaded works!");
		}

        private void OnUserConnected(IPlayer player)
        {
            if (player.HasPermission(permReturning)) return;

            Broadcast("First Time Message", player.Name);
			covalence.Server.Command("addgroup ", player.Name, FirstJoinGroup, " 2d");
			covalence.Server.Command("oxide.usergroup add", player.Id, ReturningGroup);
        }

        private void Broadcast(string key, params object[] args)
        {
            foreach (var player in players.Connected) player.Message(string.Format(lang.GetMessage(key, this, player.Id), args));
        }
		
		//This part doesn't work
		[Command("noobzombie.resetnoobs")]
		private void ResetNoobsCommand(string command, string[] args)
		{
			Puts("Command works!");
		}
		
    }
}

This is what I've got sofar



Merged post

Only the last part is not functional
  1. The first argument for commands should be IPlayer, which you do not have.
  2. Puts is a log message, it won't show you a reply in the chat or F1 console.

So like this?

[Command("noobzombie.resetnoobs")]
		private void ResetNoobsCommand(string command, string[] args)
		{
			Puts(IPlayer, "Command works!");
		}
[Command("noobzombie.resetnoobs")]
private void ResetNoobsCommand(IPlayer player, string command, string[] args)
{
    player.Reply("Command works!");
}
Working like a charm now! Thank you!
Locked automatically