1. Im looking for an addon that will delete sleeping bags once they are spawned in one time. Basically I want people to use beds or use the resources if they want to use sleeping bags repeatedly.
     
  2. I can make a plugin that simply makes sleeping bags one-time use, but not sure how I'd deal with the resource kinda thing. Unless you mean you want players to use a proper bed instead of cheap sleeping bags?
     
  3. Im not sure what Razor means by "use the resources if they want to use sleeping bags repeatedly", but I think he means that theyll have to place multiple sleeping bags down or keep placing new ones down after spawning in them (both requiring player to have to use more resources)

    I love this idea, sleeping bag is abused as a teleport too much
    and forcing to use beds requires more resources
    and for battle, beds stick out in a field since it has to be placed on a foundation :)
     
  4. I'm not sure how you guys are able to find when they spawn on a sleeping bag. :p I can't find anything.
     
  5. I probably need to start using the decompiler to look at the assembly-csharp.dll

    Anyways, ghetto way to do this, use OnPlayerRespawned Hook --->Oxide API for Rust
    search for sleeping bag in X meter radius of player (probably a super small radius),
    if find one, delete it, if multiple, delete closest one, if none, do nothing

    Get a list of entities nearby | Oxide
     
  6. I mean, that's not really optimal. I guess that would work, but what if you spawned near a random sleeping bag. I've been looking at overloads and in Assembly-CSharp.dll. If it's that simple I'll just make one now.
     
  7. Ok, so I've completed the plugin. The only issue is that if you have sleeping bags within another it removes them all, so I suppose I'll have to limit the minimum distance between multiple bags. Regardless, it's an improvement, more realistic
     
    Last edited by a moderator: Jun 7, 2017
  8. It's still not a very good solution, I'm not sure how to get the location of the sleeping bag prefab before it's even placed. I'm currently using object CanBuild(Plannner plan, Construction prefab), the problem with that is that whenever I try to get prefab.transform.position it's null, which makes sense since it's not placed yet.

    Edit: http://oxidemod.org/plugins/temporarybags.2508/ if approved, if anyone has advice on how to get the location the player tries to place it in feel free to tell me, but it still works well from my testing. :) I set the distance to 0.1f and it seems to not remove accompanying bags.