Backpacks

Moved

Total Downloads: 15,958 - First Release: Oct 30, 2015 - Last Update: Mar 6, 2018

5/5, 49 likes
  1. @XDefaultX

    Thanks for the bugfix. Too many Rust plugins are being abandoned, Good to see an author who keeps up with such a useful thing. ^.^

    In the meantime I was just playing with the visual backpacks turned off in the config. (Thanks for adding that option BTW)
     
  2. I loved the plugin when it was in its prime, I want to see it live out amongst the top plugins like it was.
    I’ll try and fix the bug when I get my computer working, I have a broken system file that’s preventing me from launching Rust.
    I’ll be reinstalling windows tomorrow then I’ll take a look at it.
     
  3. No worries, I'm going to hop in now and take a look at the various backpacks (SM, MED, LRG) on my thirdperson tonight.
     
  4. Hello,

    would be possible to place the bag in the back of the player set the value to 1?

    When the bag is in front, it makes it difficult to recover the items from the boxes
    [DOUBLEPOST=1519215545][/DOUBLEPOST]Sorry, I use Google translation to speak English, I understand that it is difficult to understand me ...

    The backpack is in front, is this normal? it's embarrassing to retrieve the objects because we can search the backpack ....

    I will try to make a screenshot, you better understand my problem

    Steam Community :: Screenshot

    again screenshot (gif): Animated GIF - Find & Share on GIPHY
     
    Last edited by a moderator: Feb 21, 2018
  5. When you try to open a "small" backpack for 6 slots, only inventory is opened, but the backpack does not appear. When you open a backpack for 12 or more slots - no problems are observed. Previously, everything worked fine
     
  6. So I've looked through the last few pages and wrote down the following:
    [​IMG]

    Is that all at the moment, or is there anything else you noticed?
    @XDefaultX Do you know of anything else?
     
  7. I have the fixed for the items I’ve mentioned.
    I can send them over to you if you’d like.
    The only other thing I’ve noticed is that it does place back ammo from increased STR guns from HuntRPG, which I believe is a problem on my side, so it’s not much to worry about.
     
  8. Alright, if you can send me a list of the fixes you've done and their changes, I'd appreciate that.
    If there happens to be something I can do on my side for the ammo issue, just notify me.
     
  9. I’ll be able to send it in a bit, going out on a date that’ll probably end horribly, heh.
    Another thing I’ve noticed (mainly other players) is that when keys are placed into backpacks, it loses its value as they key it was when it wasn’t in the backpack again, not sure if that’s able to be fixed, but its something else.
    Oh and another thing, this more of a feature request than a problem.
    Maybe have a permission for the backpack not to drop on death, I started working on it a bit ago, but never really got around to making it a thing.
     
  10. No rush from me :p Good luck ;)
    The key issue should already be on my list above.
     
  11. Ah alright, I’m on mobile right now so it’s a little hard to read all of it haha.
     
  12. I must be the only one to have this problem so, weird ...
     
  13. You are not, actually it is on my todo list as seen above.
     
  14. Would’ve sent the fixes when I got home, but Oxide was down haha
    Let me wake up and eat real quick and I’ll send it over.
    [DOUBLEPOST=1519399476][/DOUBLEPOST]
    Code:
    public static Backpack LoadOrCreate(ulong id)
                {
                    if (backpacks.ContainsKey(id))
                        return backpacks[id];                Backpack backpack = null;                if (Interface.Oxide.DataFileSystem.ExistsDatafile($"{Instance.DataFileName}/{id}"))
                        LoadData(ref backpack, $"{Instance.DataFileName}/{id}");
                    else
                    {
                        backpack = new Backpack(id);
                       if (id < 2147483647) return null;
                        SaveData(backpack, $"{Instance.DataFileName}/{id}");
                    }                backpacks.Add(id, backpack);                return backpack;
                }
    
    Fix for saving NPC data, could do with a more solid method, but it works haha.
    Code:
    private void OnEntityDeath(BaseCombatEntity victim, HitInfo info, ulong id, string perm)
            {
                if (victim is BasePlayer)
               
                {
                   BasePlayer player = (BasePlayer)victim;
                    Backpack backpack = Backpack.LoadOrCreate(player.userID);
                   if (id < 2147483647) return;
                    backpack.ForceClose();                if (Configuration.EraseOnDeath)
                        backpack.EraseContents();
                    else if (Configuration.DropOnDeath)
                        backpack.Drop(player.transform.position);
                }
            }
    
    Pretty much used the same method of solving here, but it works. Still learning C#, and my strong-suit would lie with HuntRPG. Although, I'm starting to understand everything much better.
     
  15. Do you run zombies or scientists and backpacks? If so you might want to check you probably have a few thousand backpacks files. I have a fix for the code but you will need to clear out the junk backpacks. I will send it to laserHydra and anyone interested. it basically block creation of backpacks for NPCs.

    The key is to filter out NPC in your code:

    if (!(player is BaseNpc) && !(player is NPCPlayerApex) && !(player is NPCPlayer))

    If you have a "player" plugin you might want to add some filtering.
     
    Last edited by a moderator: Feb 24, 2018
  16. Code:
    Failed to call hook 'OpenBackpackConsoleCommand' on plugin 'Backpacks v2.1.5' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.Backpacks.OpenBackpackConsoleCommand (.Arg arg) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Backpacks.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.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
      at Oxide.Plugins.Backpacks.OpenBackpackConsoleCommand (.Arg arg) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Backpacks.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.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
    some people have problem
     
    Last edited by a moderator: Feb 25, 2018
  17. How many files in \oxide\data\Backpacks ?
     
  18. 26,043
     
  19. you need to clean them out. the bot ones are tiny. my fix will stop them generating. PM me for a copy. hopefully the author will issue and official fix.
     
  20. how can unable NPC backpack?
    copy is backpack.cs file?