Jump to content

Error in Rcon

Pending 1.1.3

mufasa
mufasa

Posted

I get this error and cannot see the hud. Any Ideas?

 

Exception while calling NextTick callback (InvalidCastException: Null object cannot be converted to a value type.) at System.Convert.ChangeType (System.Object value, System.Type conversionType, System.IFormatProvider provider) [0x00019] in :0 at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00007] in :0 at Oxide.Core.Plugins.Plugin.Call[T] (System.String hook, System.Object[] args) [0x00008] in :0 at Oxide.Plugins.MinimalistHud.GetBalance (BasePlayer player) [0x00029] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.UpdateBalancePanel (BasePlayer player) [0x00021] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.LoadPlayerUI (BasePlayer player) [0x00172] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.InitializePlayersUI () [0x00015] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.b__11_1 () [0x00000] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Core.OxideMod.OnFrame (System.Single delta) [0x00051] in :0

Failed to call hook 'OnEconomicsBalanceUpdated' on plugin 'MinimalistHud v1.1.3' (InvalidCastException: Null object cannot be converted to a value type.) at System.Convert.ChangeType (System.Object value, System.Type conversionType, System.IFormatProvider provider) [0x00019] in :0 at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00007] in :0 at Oxide.Core.Plugins.Plugin.Call[T] (System.String hook, System.Object[] args) [0x00008] in :0 at Oxide.Plugins.MinimalistHud.GetBalance (BasePlayer player) [0x00029] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.UpdateBalancePanel (BasePlayer player) [0x00021] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.OnEconomicsBalanceUpdated (System.String playerId, System.Double amount) [0x00037] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.MinimalistHud.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00369] in <2be9966b31c847c4bc9aa7be3a2c5b1b>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <795304323ac74a298b8ed190a1dfa739>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000de] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0

Roger93

Posted (edited)

Error

Failed to call hook 'OnEconomicsBalanceUpdated' on plugin 'MinimalistHud v1.1.3' (InvalidCastException: Null object cannot be converted to a value type.)

Solution

1. Locate the GetBalance function in your MinimalistHud.cs file.

2. You will find something similar to this:
 

private double GetBalance(BasePlayer player)
{
    if (config.economicsPlugin.ToLower() == "economics" && Economics)
        return Economics.Call<double>("Balance", player.userID);
    else if (config.economicsPlugin.ToLower() == "iqeconomic" && IQEconomic)
        return (double)IQEconomic.Call<int>("API_GET_BALANCE", player.userID);

    return 0;
}

3. Replace it with the following code to handle possible null values:

 private double GetBalance(BasePlayer player)
        {
            if (config.economicsPlugin.ToLower() == "economics" && Economics)
                return Economics.Call<double>("Balance", player.userID.Get());
            else if (config.economicsPlugin.ToLower() == "iqeconomic" && IQEconomic)
                return (double)IQEconomic.Call<int>("API_GET_BALANCE", player.userID.Get());

            return 0;
        }

 

Edited by darkthorn
  • Like 1
mufasa

Posted (edited)

Thanks

works now 

 

 

Edited by mufasa
mufasa

Posted

Hi, I added this to the new update but doesnt seem to fix it. any ideas?

0

Downloads

Total number of downloads.

0

Customers

Total customers served.

0

Files Sold

Total number of files sold.

0

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.