1. The new Oxide build number 71 that was released earlier today brought a few small changes with it. The changes include a new hook, a small change to the timers and a new way off calling another plugin.

    The new hook
    The new hook that was added in this build is OnServerInitialized, this hook is pretty much self-explanatory and will trigger when the server has completely started and is ready to accept connections.
    Code:
    function PLUGIN:OnServerInitialized()
        Sky = global.TOD_Sky.get_Instance()
    end
    
    Timer Changes
    When the callback function of a timer failed this would result in an endless looping timer constantly throwing the error on the timer interval, with some changes to the timer system the callback that now fails will throw an actual error message and the timer will be destroyed.

    plugins.Find(string name)
    This does exactly the same as it did for Oxide 1.x and allows you to return a plugin table to be able to use the functions from that plugin. It uses the filename of the plugin as parameter. When the plugin can't be found it returns nil.
    Code:
    tp = plugins.Find("m-Teleportation")
    tp:TeleportToPosition( player, x, y, z )
     
  2. you sure on server initialized works well?
    cause i edited 3 of my plugins to match the onserverinitialized
    and i get those errors on startup:

    Code:
    [Oxide] 11:43 PM [Error] r-remover: A .NET exception occured in user-code  at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0   at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [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
    (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebug.gen.cpp Line: 56)[Oxide] 11:43 PM [Error] r-Zones: A .NET exception occured in user-code  at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0   at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [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
    
    [DOUBLEPOST=1419893179][/DOUBLEPOST]where as when i reload the plugin or unload/load, it doesnt give this error.
    just gives the error when the server starts.
     
  3. Wulf

    Wulf Community Admin

    The hook is working for me, but I haven't done anything more than print a message.
     
  4. try this:
    Code:
    nulVector3 = new(UnityEngine.Vector3._type,nil) 
    the only thing that matchs those 2 plugins.
     
  5. Wulf

    Wulf Community Admin

    That does error for me.
     
  6. so either it's using:
    new()
    or creating a new variable
    that is making the error :p
     
  7. Have been using the hook for a lot in some of the plugins i'm toying around with. I do know that new() can sometimes cause ambiguous matching errors though.
     
  8. Well to prévent that we used à timer.Once so the new would start after server initialized, but you broke the timer on start now ^^
     
  9. It's rather fixing then breaking, a timer shouldn't repeatedly run when the callback triggers an exception :p Just use lua error handling (pcall), think I posted it in your zones plugin earlier today :)
     
  10. pcall da fuck ^^?