Fix CS7036: no argument given for required parameter 'callback' in Oxide plugins
CS7036 means a method call is missing an argument that the method has no default for. In Oxide plugins this is almost always a timer call such as timer.Once(seconds) with no callback, or timer.Repeat/NextTick called with the wrong number of arguments.
Error while compiling RestartTimer: [1] There is no argument given that corresponds to the required parameter 'callback' of 'PluginTimers.Once(float, Action)' at 33:34
Why it happens
The timer API in Oxide takes the delay and an action to run. timer.Once(float seconds, Action callback) has no overload without the callback, so timer.Once(30f); cannot compile: the compiler refuses to build the call. PluginTimers also exposes timer.Repeat(float seconds, int times, Action callback) and timer.Every(float seconds, Action callback), and NextTick(Action callback); the same error appears when one of those is called with a missing or mistyped argument. A common trigger is writing the callback body as a block right after the call, or a leftover statement like timer.Once(delay, this.SomeMethod); where SomeMethod was meant to be a lambda. Another trigger is calling your own helper method that declares a required parameter without it. Oxide removes the failing file from the batch and does not load the plugin until the file compiles again.
How to fix it
- Read the line and column in the console message; it points at the call, not the method definition.
- If it is a timer, add the second argument as a lambda:
timer.Once(config.RestartDelaySeconds, () => { ... });. The lambda body holds what should run when the timer fires. - Keep a reference if you may need to cancel it:
private Timer restartTimer;thenrestartTimer = timer.Once(...);andrestartTimer?.Destroy();inUnload(). - If the error is on your own method, either pass every declared argument or give the parameter a default value (
float delay = 30f). - Save the file and run
oxide.reload RestartTimer. A clean build printsLoaded plugin RestartTimer v1.0.0 by RustPluginGenerator; any remaining error printsError while compiling RestartTimer:again with the next problem.
Before and after
using System;
using Oxide.Core;
namespace Oxide.Plugins
{
[Info("Restart Timer", "RustPluginGenerator", "1.0.0")]
[Description("Kills a countdown message, then warns players that a restart is coming.")]
public class RestartTimer : RustPlugin
{
private Timer warningTimer;
[ChatCommand("restartwarn")]
private void CmdRestartWarn(BasePlayer player, string command, string[] args)
{
if (player == null)
{
return;
}
float delay = 10f;
if (args != null && args.Length > 0)
{
float.TryParse(args[0], out delay);
}
if (warningTimer != null)
{
warningTimer.Destroy();
warningTimer = null;
}
// Error: Once requires a second argument (the Action to run)
warningTimer = timer.Once(delay);
SendReply(player, string.Format("Restart warning scheduled in {0} seconds.", delay));
}
private void AnnounceRestart()
{
Server.Broadcast("Server restart in 5 minutes. Save your progress.");
Puts("Restart warning broadcast.");
}
private void Unload()
{
if (warningTimer != null)
{
warningTimer.Destroy();
warningTimer = null;
}
}
}
}using System;
using Oxide.Core;
namespace Oxide.Plugins
{
[Info("Restart Timer", "RustPluginGenerator", "1.0.0")]
[Description("Kills a countdown message, then warns players that a restart is coming.")]
public class RestartTimer : RustPlugin
{
private Timer warningTimer;
[ChatCommand("restartwarn")]
private void CmdRestartWarn(BasePlayer player, string command, string[] args)
{
if (player == null)
{
return;
}
float delay = 10f;
if (args != null && args.Length > 0)
{
float.TryParse(args[0], out delay);
}
if (warningTimer != null)
{
warningTimer.Destroy();
warningTimer = null;
}
// Fix: the lambda is the callback Timer runs when the delay elapses
warningTimer = timer.Once(delay, () => AnnounceRestart());
SendReply(player, string.Format("Restart warning scheduled in {0} seconds.", delay));
}
private void AnnounceRestart()
{
Server.Broadcast("Server restart in 5 minutes. Save your progress.");
Puts("Restart warning broadcast.");
}
private void Unload()
{
if (warningTimer != null)
{
warningTimer.Destroy();
warningTimer = null;
}
}
}
}FAQ
Why does timer.Once need a callback?
The delay alone does nothing; Timer runs the Action you pass when the delay elapses. Oxide.Plugins.Timer has no one-argument Once, so the compiler reports CS7036 for the missing parameter rather than a warning.
Can I pass a method name instead of a lambda?
Yes, if the signature matches void MethodName(). Write timer.Once(5f, SendWarning); for a parameterless method. If the method has parameters, wrap it in a lambda: timer.Once(5f, () => SendWarning(message));.
Will the plugin still run with this error?
No. Oxide drops the failing file and compiles the rest of the batch, but RestartTimer is not loaded, so its commands, permissions and hooks are unavailable until the code compiles.
What about CS1501?
CS1501 (no overload takes N arguments) appears when a call has too many arguments or none of the overloads match the types. CS7036 is the specific case of a call with too few, and the message names the missing parameter.
Different error?
Paste the full console output and get the cause and a fix in plain English.
Open the error explainerSkip the debugging
Generated plugins are compiled before you get them, and compiler errors are fixed automatically.
Generate a plugin2 free plugins a month, no card.
Last updated Oct 26, 2026.
Get plugins that compile first time
Generate