Since I can't use the System Timer, how can I achieve this with Oxide?
using System;
namespace Oxide.Plugins
{
[Info("Restarter", "Lazeer", "0.01")]
public class Restarter : RustPlugin
{
void Init()
{
Puts("Waiting for restart command");
}
[ConsoleCommand("timedrestart")]
private void TestCommand()
{
Puts("Server Restart in 5 minutes.");
//Server.Broadcast("Server Restart in 5 minutes.");
timer.Repeat(3f, 0, () =>
{
Puts("I will run once every second");
});
}
}
}
Currently it's not running every one second but rather every 3 frames. How can I make it execute every 1 second?
(19:22:05) | [Restarter] 1 second
(19:22:08) | [Restarter] 1 second
(19:22:11) | [Restarter] 1 second
(19:22:14) | [Restarter] 1 second
I hope I posted this in the right place. It's a Rust specific plugin.