1. Hello all, does anyone have any ideas on simulating death? Like on FUN-RUST when a player dies, they dont really die. They just fall asleep. Any help is REALLY appreciated. ;)
     
  2. Not sure, but it just checks, in OnEntityDeath checks, if player hp < 0, player.SetPlayerFlag(PlayFlag.Sleeping, true), prevent death, teleport to new location and turn flag to false.
     
  3. object OnPlayerWound(BasePlayer player)
    {
    // Teleport to POS
    // Stop Wounded
    // profit
    }
     
  4. From MiniGames.cs :)

    Code:
            private object OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info)
            {
                if(!(entity is BasePlayer) || info.damageTypes.GetMajorityDamageType() == DamageType.Fall) // block fall damage and detect damage only from players
                    return false;            BasePlayer victim = entity as BasePlayer;            if(victim == null || victim.IsSleeping())
                    return false;            float damageAmount = info.damageTypes.Total();
              
                if(info.isHeadshot) // SLOWHACK FIX FOR DEATH SCREEN, damage for armor calculate in next frame
                    damageAmount *= 2;
                      
                if((victim.health - damageAmount) < 1)
                {             
                    Interface.CallHook("OnPlayerDie", victim, info); // if need
                  
                    // Teleport
                    // Reset HP, Metabolism                return false;
                }
              
                return null;
            }
    [DOUBLEPOST=1517581759][/DOUBLEPOST]I think found a new way, if my guesses are confirmed, then lay out a new solution this weekend :)
     
    Last edited by a moderator: Feb 2, 2018
  5. Code:
    private object OnPlayerDie(BasePlayer victim, HitInfo info)
    {       
        // Kit
        // Teleport
        
        NextTick(() => // SLOWHACK FIX FOR BLEEDING
        {   
            if(victim.IsConnected)
                victim.metabolism.bleeding.value = 0f;
        });               
        
        return false;
    }
     
  6. Thanks, really appreciate the help