Inventory Guardian

Restore players inventory even after server wipe

Total Downloads: 3,604 - First Release: Jan 12, 2015 - Last Update: Feb 4, 2017

5/5, 19 likes
  1. Also I found a similar bug with restoring inventory after death.
    Since IG.Data.RestoreOnce[playerID] may be true after server wipe or something else then we need to delete this flag.
    Code:
    …
    Line 759:         if self.Config.Settings.RestoreUponDeath then
    Line 760:         -- Save player inventory
    Line 761:         IG.Data.RestoreOnce[playerID] = nil
    Line 762:         IG:ClearSavedInventory(playerID)
    Line 763:         else
    …
    I added IG.Data.RestoreOnce[playerID] = nil (line 761) for myself. Now it works fine.

    Or have I missed something and inventory just saves w/o restoring?
     
    Last edited by a moderator: Feb 1, 2015
  2. I think corpses should be empty (after saving of course) if AutoRestore and RestoreUponDeath are true.
    function PLUGIN:OnEntityDeath(entity)
    -- Convert entity to player
    local player = entity:ToPlayer()

    -- Check if entity is a player
    if player then
    -- Grab the player his/her SteamID.
    local playerID = rust.UserIDFromPlayer( player )

    -- Add playerID to player death list
    IG.PlayerDeaths[playerID] = true

    -- Check if the Restore upon death is enabled
    if self.Config.Settings.RestoreUponDeath then
    -- Save player inventory
    IG:SavePlayerInventory(player)
    player.inventory:Strip()
    else
    -- Reset saved inventory
    IG:ClearSavedInventory(playerID)
    end
    end
    end After typing /ig.save or /ig.restore on players I got this:
    [​IMG]
    [​IMG]
     
  3. NexusBR updated Inventory Guardian with a new update entry:

    Minor fix on /ig.save and /ig.restore when using other plys


    [DOUBLEPOST=1423067620][/DOUBLEPOST]
    OK, Thanks, it was fixed, it was a little left over from the code rewrite.
    We should not break the lore/fun from Rust, If we strip the dead players body from all the items we will keep other players from getting the player loot.
    Anyways by default Restore Upon Death is disabled.
     
  4. I have an idea, do you think you will add something like a blueprint support? I mean when someone learn a blueprint, the blueprint is save, and when the player log after a WIPE, he types like /blueprint and it gives him blueprint he learnt ? or /blueprint <name> ?

    Nice day! (Sorry for poor english)
     
  5. Blueprints already saves w/o any plugins. If your craft list was wiped then this means admin deleted players profiles manually.
     
  6. Indeed while map save is saved on $SERVERID/save, Blueprints are saved on $SERVERID/persistence.
    So even if the server owner wipe the whole save map folder, Blueprints are saved.

    But i think Rust blueprints could be saved on one global server like Team Fortress 2 Item Manager or DotA 2 Item Manager servers.

    But garry is too lazy to do that.
     
  7. Oh that's nice! thanks for reply!
     
  8. Wulf

    Wulf Community Admin

    Temporary build compatible with Oxide builds 266+.
     

    Attached Files:

  9. We are getting errors when restoring inventories since the 26th Feb updates.
     
  10. If you are getting errors from Inventory Guardian, And you want it fixed, You NEED to REPORT this ERRORS...
     
  11. Hey guys, thanks for the great plugin.

    I'm trying to modify this to allow me to send commands from the console to delete the inventory of a player. Specifically I cannot connect to my server because my inventory is messed up. Any suggestions? Thanks!
     
  12. I'm already developing a command to do that, Delete all saved inventories or a player inventory.
     
  13. Fantastic, thanks! I got close but haven't been able to figure out exactly how to direct arguments into the function. Let me know if I can help in any way!
     
  14. Lol my memory are fried, i already developed that command: /ig.delsaved PlayerName or ig.deleteall on console to delete all is on the description
    [DOUBLEPOST=1425153308][/DOUBLEPOST]I'm implement item health save and BP save feature on Inventory Guardian now.
    And fixed /ig.strip giving error.
    I'll publish soon i done implementing and test.
     
  15. My Players now jumping from their House into dead. Inventory Guardian restores their Inventory. Then they loot the dead Body and have doubled the Inventory :mad:
     
  16. That is because You or some admin enabled the keep Inventory Upon death, to disable run chat command: /ig.restoreupondeath or console command ig.restoreupondeath.

    Or you are using a very old version of Inventory Guardian...:confused:

    [DOUBLEPOST=1425161636][/DOUBLEPOST]And if you want you can wipe all the saved inventory IF you are using an updated version by running ig.deleteall on console you can wipe all the saved players inventories.

    So next time they kill themselves they will have nothing if you disabled restore Upon Death.

    :rolleyes:
     
    Last edited by a moderator: Mar 1, 2015
  17. NexusBR updated Inventory Guardian with a new update entry:

    Lots of improvements.

     
  18. Ah but /ig.delsaved playername is a chat command. For this to help admins who can't login it would have to be a console command. ig.deleteall deletes all players' inventories which is unnecessary if all you need to delete is one player's inventory.