Hello hopefully I am posting in the right place. I'm trying to write a custom plugin that will slowly increase the `oceanlevel` convar in Rust throughout the duration of a wipe. The problem is the actual method that is supposed to start the timer with callback just never seems to actually run. The pause and reset methods emit messages to the console, but the actual flood method does absolutely nothing. No errors or anything, it just does nothing. If anyone can guide me in the right direction and let me know what I am doing wrong I'd be eternally in your debt.
My code is on PasteBin here -- https://pastebin.com/c5KJ4UsQ
Can't get console command to do anything
Are you running it as a server command? That's the only way I got it to work.
rust.RunServerCommand("oceanlevel 7"); ZugzwangAre you running it as a server command? That's the only way I got it to work.
rust.RunServerCommand("oceanlevel 7");
Thanks for the reply. I have tried updating my calls to this, even so far as making a simple method like this one
[Command("flooder.max")]
void FloodMax(ConsoleSystem.Arg arg)
{
rust.RunServerCommand("env.oceanlevel", _maxHeight);
arg.ReplyWith("Set Ocean Level to " + _maxHeight);
}
Merged post
Turns out I was just using the wrong attributes for the methods that weren't running, I was using Command instead of ConsoleCommand. If anyone find this thread in the future and needs a similar answer, my updated working code can be found here