1. My Rust server restarts each night at 7AM and I'm seeing this error relating to one of my plugins - when I FTP the plugin to the server it loads fine with no errors, and runs as expected. The error is:

    Code:
    07:00 [Info] Loaded plugin Friend Not Foe - Next Wipe v1.0.0 by Rebajas
    07:00 [Debug] ExType: TargetInvocationException
    07:00 [Error] Failed to initialize plugin 'nextWipe v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
    07:00 [Debug]   at ConsoleSystem.Broadcast (System.String strCommand, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Game.Rust.Libraries.Rust.BroadcastChat (System.String name, System.String message, System.String userId) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      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 
    To me it looks like something to do with the BroadcastChat - but I'm not sure what.

    Any help appreciated.
     
  2. Wulf

    Wulf Community Admin

    Something you are trying to use with BroadcastChat is null, likely a player or message. You'd need to check for and figure out what is null. Most likely something isn't available yet when you are trying to call it.
     
  3. Ahh - okay, thanks :)
     
  4. Apparently Rust doesn't like doing a BroadcastChat in the Init function when the server is restarting :) removed it and all good.
     
  5. Wulf

    Wulf Community Admin

    Yeah, that should be in OnServerInitialized.
     
  6. Ahh, cool. I can live without for this but that's still useful to know...