Slap ok but no damage lostSolved

hello,

/slap tanki 75 1 => slap ok, stay to 100hp ^^
/slap tanki 75 1 3 => slap ok, stay to 100hp but not slapped 3 times

Thanks for a fix.

using skilltree plugin, idk if is it related...

is not skilltree the problem, ested with a player having no skill and same probleme, he slapped but no lost hp

Tanki

is not skilltree the problem, ested with a player having no skill and same probleme, he slapped but no lost hp

Slap.cs:

player.Hurt(damage * intensity);​

this is why. all unknown sources of damage from primary damage types are blocked by TruePVE to protect the player. it would require an initiator (such as the player for self-damage) to be allowed, or an excluded damage type (radiation) to not be evaluated.

        private void SlapPlayer(IPlayer player, float damage = 0f, int intensity = 0, int amount = 0)
        {
            damage = damage > 0f ? damage : config.DefaultDamage;
            intensity = intensity > 0 ? intensity : config.DefaultIntensity;
            amount = amount > 0 ? amount : config.DefaultAmount;

#if RUST
            BasePlayer basePlayer = player.Object as BasePlayer;
            timer.Repeat(0.6f, amount, () => {
                if (basePlayer != null && basePlayer.IsConnected)
                {
                    basePlayer.Hurt(damage * intensity, Rust.DamageType.Radiation);
                }
            });
            BaseEntity.Signal[] flinches = new[]
            {
                BaseEntity.Signal.Flinch_Chest,
                BaseEntity.Signal.Flinch_Head,
                BaseEntity.Signal.Flinch_Stomach
            };
            BaseEntity.Signal flinch = flinches[random.Next(flinches.Length)];
            basePlayer.SignalBroadcast(flinch, string.Empty, null);
            string[] effects = new[] // TODO: Move to configuration
            {
                "headshot",
                "headshot_2d",
                "impacts/slash/clothflesh/clothflesh1",
                "impacts/stab/clothflesh/clothflesh1"
            };
            string effect = effects[random.Next(effects.Length)];
            Effect.server.Run($"assets/bundled/prefabs/fx/{effect}.prefab", basePlayer.transform.position, UnityEngine.Vector3.zero);
#else
            timer.Repeat(0.6f, amount, () => {
                if (player != null && player.IsConnected)
                {
                    player.Hurt(damage * intensity);
                }
            });
#endif

            GenericPosition pos = player.Position();
            player.Teleport(pos.X + random.Next(1, intensity), pos.Y + random.Next(1, intensity), pos.Z + random.Next(1, intensity));
        }​

Thansk very much nivex! it work now!

Locked automatically