Rust Item dropping on death

Discussion in 'Plugin Requests' started by Rickne, Jun 1, 2017.

  1. Is there a plug in or command that causes a player to drop all items on death? Simple as that . :) thanks.

    (sorry Wulf i know this is technically a request but as i saw a similar topic referring to legacy i hoped something might exist for current builds).
     
  2. I'd imagine that this would be easy to make. Have some functions within OnEntityDeath and loop through the victim's inventory and automatically drop each item.
     
  3. Ok well I guess i would fully request from @Wulf to move this to requests in which case. Would be a great addition to my PVP server. Thanks.
     
  4. I imagine this would cause some degree of server lag if these items are not picked up in a timely matter.
     
  5. IMO lag would depend on how many players are dying, how often, and how much loot they had on them. Even then it would likely only affect nearby players if at all. It wouldnt be any worse then destroying a base and having all the loot containers break apart.

    Code:
    // Phone code
    void OnEntityDeath(BaseCombatEntity entity, HitInfo info)
    {
       var player = entity.ToPlayer()
       if (player != null)
       {
          DropUtil.DropItems(player.inventory.containerMain, player.transform.position);
          DropUtil.DropItems(player.inventory.containerBelt, player.transform.position);
          DropUtil.DropItems(player.inventory.containerWear, player.transform.position);
       }
    }
    
     
  6. Yeah to be honest im not running a busy server right now . An the time a dropped item lasts before despawning isnt too long.

    I was going to suggest a dropable box like in Arma or PUBG but then why then not just loot the body anyway. The backpack plug in has kind of got this down but Id rather not have physical boxes lying around you can use as a boost. The other idea was to just flush the dead players tool bar only. ?
     
  7. Would
    Code:
    if (entity is BasePlayer)
    
    work?