AntiLootDespawn

Stop defenders from despawning their loot

Total Downloads: 1,070 - First Release: Aug 13, 2016 - Last Update: Mar 17, 2017

5/5, 4 likes
  1. Bamabo submitted a new resource:

    AntiLootDespawn - Change loot despawn time in cupboard radius

    Read more about this resource...
     
  2. I get: Invalid Command: antilootdespawn.enabled.true

    The multiplier commands seems to work fine..

    also.. I just unloaded it and deleted the plugin.. now items I've dropped are NOT despawning, PERIOD. Oh SH*T man? lol I am doing some more testing and I ran server.itemdespawn 300 in console
     
  3. antilootdespawn.enabled.true should be antilootdespawn.enabled true

    And yeah things that you have dropped previously will not be despawning because of how the plugin changes the despawn duration. It cancels the function that will despawn them, then restarts it. server.itemdespawn 300 means that the absolute shortest time it will take for an item to despawn is 5 minutes (300 seconds). That value will be multiplied by the rarity of the item. So things like AKs and Rocket Launchers will take 1200 seconds.

    The item rarities are as follows:
    None = 0
    Common = 1
    Uncommon = 2
    Rare = 3
    VeryRare = 4


    Also worth noting the despawn duration when using this plugin is the following:
    itemdespawn * item rarity * antilootdespawn.multiplier
    While the normal duration is
    itemdespawn * item rarity
     
    Last edited by a moderator: Aug 16, 2016
  4. Ahh ok thanks for the prompt reply.. and pointing out my typo lol :D

    I did just drop a Supply Signal and it's sticking around for a lot longer than 300 seconds though, but it did eventually despawn... does this plugin "stick around" somehow, even after I've unloaded it and deleted the .cs and .json file? Or is the default behavior of Rust to make certain items stick around longer, based on rarity? Sorry for so many questions, I'm just trying to learn! I ask because I swear some plugins "stick around" even after you unload and delete their files.. like HeliControl.. I've had non-stop weirdness with Heli's ever since I first ran that plugin!

    Also, if it's helpful, I found stuff in my log.error file:
    [08/15/2016 16:57:43] [Oxide] 16:57 [Error] Failed to call hook 'cmdMultiplier' on plugin 'AntiLootDespawn v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
    [08/15/2016 16:58:04] [Oxide] 16:58 [Error] Failed to call hook 'cmdEnabled' on plugin 'AntiLootDespawn v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
     
  5. Bamabo updated AntiLootDespawn with a new update entry:

    1.0.1

     
  6. ^^ you read my mind haha
     
  7. No problem with the questions, I love to explain stuff xD

    So I'm going to do a tiny writeup about exactly what happens when an item is dropped.
    Basically every single item in rust has a rarity attached to it, the less valuable they are the lower the rarity. So things like bandages, raw wood etc has a very low rarity. Common or Uncommon.

    The default behavior when an item is dropped is that a function is called to despawn the item after a certain duration. This duration is bound to two things
    1. The server ConVar itemdespawn
    2. The rarity of the item
    So let's consider you dropping 1 piece of wood. The server is then told "Hey, Genocide just dropped a raw piece of wood. Please despawn it after itemdespawn*item rarity." Where the rarity has a value between 0-4 depending on how rare the item is. In other words the more rare an item is the longer it will take for the item to despawn. Since wood is of the rarity Common and common has the value 1 means that the piece of wood will be despawned after itemdespawn * 1. So if your itemduration = 30 then it would despawn in 30 seconds. Would you instead drop an AK which has the rarity VeryRare(4) it would despawn after itemdespawn(30) * rarity(4) = 120 seconds.

    Then what my plugin does is that it multiplies itemdespawn * rarity with the multiplier. So if itemdespawn = 30 and the rarity = 4 and the multiplier = 2 then the full despawn time would be: itemdespawn(30) * rarity(4) = 120 * multiplier(2) = 240 seconds. If the item was dropped inside of a cupboard radius that is.

    I hope that clears things up. And feel free to ask if you have any more questions.
     
    Last edited by a moderator: Aug 17, 2016
  8. Yes that is very clear! I am giving it a go again, I'll post back here if I see anything weird.
     
  9. Alright, let me know if you stumble upon any trouble!
     
  10. Thank you ! This plugin is usefull for my server !
     
  11. Code:
    (10:36:54) | [RCON][149.202.87.97:52773] antilootdespawn.enabled true
    (10:36:54) | [Oxide] 10:36 [Error] Failed to call hook 'cmdEnabled' on plugin 'AntiLootDespawn v1.0.1' (NullReferenceException: Object reference not set to an instance of an object)
    (10:36:54) | [Oxide] 10:36 [Debug] at Oxide.Plugins.AntiLootDespawn.cmdEnabled (.Arg args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.AntiLootDespawn.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (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 name, System.Object[] args) [0x00000] in <filename unknown>:0
     
    Last edited by a moderator: Aug 16, 2016
  12. I see you are trying to use the command through RCON, which is currently not supported by the plugin. I will roll out an updated soon which will fix that.
     
  13. Bamabo updated AntiLootDespawn with a new update entry:

    1.1.0


    [DOUBLEPOST=1471416220][/DOUBLEPOST]
    This update adds RCON support.
     
  14. Quick release !
    Thank you :)
     
  15. You're welcome. Let me know if you find any bugs or want any additional features.
     
  16. I will not miss it ! :)
     
  17. @Bamabo Could you make it so that there are 2 different times depending on if it's inside a TC range or not? :D
     
  18. I'm getting the following error on today's update.

    Code:
    Failed to compile: AntiLootDespawn.cs(108,27): error CS0122: `ConsoleSystem.Arg.CheckPermissions()' is inaccessible due to its protection level
     
  19. To fix it, go into the CS file, search for:

    CheckPermission

    There should be 3 section with this statement. You need to remove the the else section statement.. An example would be this:

    ORIGINAL (bugged version):
    {
    if(args.Player() != null)
    {
    if (!args.Player().IsAdmin() && !permission.UserHasPermission(args.Player().UserIDString, "antilootdespawn.multiplier"))
    return;
    }else
    {
    if (!args.CheckPermissions())
    return;
    }

    if (args.HasArgs())

    FIXED:
    {
    if(args.Player() != null)
    {
    if (!args.Player().IsAdmin() && !permission.UserHasPermission(args.Player().UserIDString, "antilootdespawn.multiplier"))
    return;
    }

    if (args.HasArgs())

    Remove those THREE sets of "else" statements, and it will be fixed.
     
    Last edited by a moderator: Feb 10, 2017
  20. Wulf

    Wulf Community Admin

    Wulf updated AntiLootDespawn with a new update entry:

    1.1.1