Config file doesn't generate.okay, so here is the code, hilited:
JavaScript:// this is a javascript object: var GatherRate = { // this line creates the "GatherRate" object's "Enabled" property // return true or false as boolean and not as string get Enabled () { return DataStore.Get("GatherRate", "Enabled");}, get Rate () {return DataStore.Get("GatherRate", "Rate");} }; function On_PluginInit(){ // create ini if it doesn't exist if(!Plugin.InitExists("Config")){ var ini = Plugin.CreateIni("Config"); ini.AddSetting("Main", "Enabled", true); ini.AddSetting("Main", "GatherRate", 2); ini.Save(); } // no doubt it exists now var ini = Plugin.GetIni("Config"); // store the settings in the ds, when you load the server // its faster to read it from the memory, then open a file every time // this line will store the "Enabled" value as a boolean instead of a string DataStore.Add("GatherRate", "Enabled", ini.GetSetting("Main", "Enabled")=="true"?true:false); DataStore.Add("GatherRate", "Rate", parseFloat(ini.GetSetting("Main", "GatherRate"))); } // use this if you want to gather faster, but not more function On_GatherEvent(Player, GatherEvent){ // check if gatherrate is enbaled if(GatherRate.Enabled){ // multiply the gathered quantity with the desired gathering rate GatherEvent.Quantity *= GatherRate.Rate; } } // use this if you want to gather faster and more as well // with this if you set gatherrate to 9, you should get ~900 woods from a woodpile /*function On_GatherEvent(Player, GatherEvent){ if(GatherEvent.Enabled){ var qty = GatherEvent.Quantity; var qty = parseInt(Math.floor((qty * GatherRate.Rate) - qty)); // I'm not sure if you need parseint or not Player.Inventory.AddItem(GatherEvent.Item, qty); Player.InventoryNotice(qty + " x " + GatherEvent.Item); } }*/
Tried to make the Config file myself and it seems it doesn't read it.
Server says it was loaded successfully & no errors...