Hello,
I recently put in more logging for my server into Logger made by Wulf. I specifically wanted logging for chest looting, which i have made, there is a problem though, but a rare one.
Here is the logger code:
Error code:Code:void OnLootEntity(BasePlayer player, BaseEntity entity) { if (player == null) return; if (entity == null) return; if (logLoot) Logg("loot", Lang(player.displayName + " (" + player.UserIDString + ")" + " has started looting " + entity + " at " + entity.transform.position)); }
Now this does not happen to every single player, in fact only to one specific player. Every time this said player is involved and some sort of entity need's to be called, it ends in a similar error. I have even put in null checkers, but still gives errors.Code:Failed to call hook 'OnLootEntityEnd' on plugin 'Logger v2.0.4' (FormatException: Input string was not in a correct format.) at System.String.ParseFormatSpecifier (System.String str, System.Int32& ptr, System.Int32& n, System.Int32& width, System.Boolean& left_align, System.String& format) [0x00000] in <filename unknown>:0 at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0 at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Logger.Lang (System.String key, System.String id, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Logger.OnLootEntityEnd (.BasePlayer player, .BaseEntity entity) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Logger.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [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 hook, System.Object[] args) [0x00000] in <filename unknown>:0
Though i have managed to find out that the "entity" part in the logger string, is causing it. So it is when it calls for the entity. I have even done if statements, but it still ends in this error. I have tried everything i could think of, but in vain.
I'd appreciate any help i get.
FormatException: Input string was not in a correct format
Discussion in 'Rust Development' started by Tori1157, Sep 23, 2017.
-
Wulf Community Admin
They isn’t a hook error, it is with your message that you are trying to format. My guess is your attempt at making the entire entity object a string.
-
Last edited by a moderator: Sep 23, 2017
-
-
His name is "{MDA} Trippin". I tried out to join with "{}" in my name, but it did not cause the same issue. But perhaps it hadn't updated yet...
-
Wulf Community Admin
-