Solved Getting damage under OnEntityTakeDamage hook?
Discussion in 'Rust Development' started by mr.Varzhak, Nov 20, 2015.
-
Calytic Community Admin Community Mod
Damage is calculated for each damage type. You can average all the damage types together or you can do something like the following
Code:float damage = hitinfo.damageTypes.Get(hitinfo.damageTypes.GetMajorityDamageType());
-
It does not work, there are other options?
-
Should work, though I think you may need to put it on a NextTick for it to get the proper damage amount, like this:Code:
var damages = info?.damageTypes?.Total() ?? 0f;
Code:NextTick(() => { var damages = info?.damageTypes?.Total() ?? 0f; });
