1. Oxide 1.18 has been discontinued and is no longer supported. Please do not post requests for Oxide 1.18 plugins or support.
    We recommend upgrading to Oxide 2.0 as able. Plugins can be easily updated to support it as well.

Solved On plugin unload

Discussion in 'Legacy Development' started by PreFiX, May 7, 2016.

  1. PreFiX

    PreFiX Shack Builder Plugin Developer

    Code (Text):

            void OnPluginUnloaded(Plugin name) {
                if(name == this) {
                    if(PlayerClient.All.Count > 0) {
                        List<NetUser> netusers = PlayerClient.All.Select(pc => pc.netUser).ToList();
                        if(!netusers.Any()) { Puts("Found players, but couldn't make a list.... Odd..."); return; }
                        foreach (NetUser netuser in netusers) SaveUserData(netuser);
                    }
                }
            }
     
    Why it doesn't work? I want to save my users data after plugin "reload/edit"...
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Use Unload(), not OnPluginUnloaded. The OnPluginUnloaded hook is meant for listening for other plugins.