After today's update I am getting this error on one of my personal plugins
It seems very similar to this error which came right after the update but was quickly fixed with another update.Code:[Oxide] 5:12 PM [Error] Failed to call hook 'OnPlantGather' on plugin 'Gather Stats' (ArgumentException: failed to convert parameters) [Oxide] 5:12 PM [Debug] at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
Should something be fixed within oxide for OnPlantGather as OnTrapSnapped needed? Or is it my plugin that is the problem?
Solved Failed to call hook 'OnPlantGather'
Discussion in 'Rust Development' started by Zhahaman2001, Jul 30, 2015.
-
Wulf Community Admin
It requires a the player argument now as well, as per the update notes.
-
I believe my arguments are correct
Code:private void OnPlantGather(BaseEntity.RPCMessage msg, PlantEntity plantentity, Item item) { try { GatherItem(item.info.itemid, item.amount, msg.player.net.connection.userid); } catch { PrintError("Error handling on gather!"); } }
-
Wulf Community Admin
OnPlantGather(PlantEntity entity, Item item, BasePlayer player)
-
Thx wolf your the man!
rtf when I put in my github pull request for this I added the RPCmsg at the end
When I decompile I still see the hook arguments set up as "msg, this, item" but maybe Im looking at an old version? -
Wulf Community Admin
See https://github.com/OxideMod/Oxide/blob/master/Oxide.Game.Rust/RustCore.cs#L1006. -
I see now! Thank you!!!