-Fougerite Version: 1.0.3F
-Error only happens when player gathers.
Hey there,
So I am trying to create a CFG file to change the gather rate, The problem is that the plugin is give me errors:
Any want to help a noob? 
Thy Code
-Error only happens when player gathers.
Hey there,
So I am trying to create a CFG file to change the gather rate, The problem is that the plugin is give me errors:
Code:
Error invoking function On_PlayerGathering in GatherRate plugin.
OverflowException: Number overflow.
Thy Code
JavaScript:
function On_PluginInit() {
if(!Plugin.IniExists("Config"))
{
Plugin.CreateIni("Config");
var iniCfg = Plugin.GetIni("Config");
iniCfg.AddSetting("Config", "Enabled", "True");
iniCfg.AddSetting("Config", "GatherRate", 2);
iniCfg.Save();
}
}
function On_PlayerGathering(Player, GatherEvent) {
var iniCfg = Plugin.GetIni("Config");
if (iniCfg.GetSetting("Config", "Enabled") == "False") {
return;
}
var mult = parseInt(Data.GetConfigValue("GatherRate", "Config", "GatherRate"));
Player.Inventory.AddItem(GatherEvent.Item, Math.floor(GatherEvent.Quantity * (mult-1)));
Player.InventoryNotice(GatherEvent.Quantity * (mult - 1) + " x " + GatherEvent.Item);
}
Last edited: