Returns this when I attempt to launch the plugin-Code:void LoadDefaultConfig() { Config.Clear(); //Interest// Config["Interest - Enabled"] = true; Config["Interest - Rate"] = 10.0; Config["Interest - Timer"] = 15; Config["Interest - IncreaseP"] = 0.5; Config["Interest - RaiseM"] = 60; Config["Interest - MaxInterest"] = 75.0; Config["Interest - MinInterest"] = 10.0; Config["Interest - InterestLostOnDeath"] = 1.0; //Starting Eco// Config["Starter - RustDollars"] = 1000; //General Config// Config["Economics - MaxRustDollars"] = 1000000; Config.Save(); } public int InterestTimer = Convert.ToInt32(Config["Interest - Rate"]);
Code:[Oxide] 16:20 [Error] EnhancedEconomics plugin failed to compile! [Oxide] 16:20 [Error] EnhancedEconomics.cs(46,52): error CS0236: A field initializer cannot reference the nonstatic field, method, or property `Oxide.Core.Plugins.Plugin.Config'
Config Problems
Discussion in 'Rust Development' started by DylanSMR, Apr 4, 2016.
-
Wulf Community Admin
Why does InterestTimer need to be public? Try nothing (default of private) or setting it to private.
-
Set it to nothing as well tried private neither works. Still gives me a error.
-
You need to move it to the Init()
Code:int InterestTimer;void Init() { InterestTimer = Convert.ToInt32(Config["Interest - Rate"]); }
