I can't seem to create an instance of the Timer class but can use one of its functions as if it were static ( timer.Repeat() ). But when I look inside the Timer class definition it doesn't appear to be static. Also the Timer class starts with an uppercase T but the timer.Repeat function is called with a lowercase t? The Timer class I am looking at is inside the Oxide.Core Assembly. Could someone please explain the Timer class to me and why this is happening?
This works:
Code:void OnPluginLoaded(Plugin name) { timer.Repeat(60f, 100, spawnCar); }
This does not work:
Error from code example #2Code:void OnPluginLoaded(Plugin name) { Timer t = new Timer(); t.Repeat(60f, 100, spawnCar); }
Code:Error while compiling: CarSpawn.cs(33,15): error CS1061: Type `Oxide.Plugins.Timer' does not contain a definition for `Repeat' and no extension method `Repeat' of type `Oxide.Plugins.Timer' could be found. Are you missing an assembly reference?
Solved Using timers?
Discussion in 'Rust Development' started by Bananas_In_Pajamas, Nov 15, 2017.