Blocking heli damage on construction?
Discussion in 'Rust Discussion' started by Insin, Dec 11, 2016.
-
Code:
private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo) { if (entity == null || hitInfo == null) return; if (entity is BuildingBlock && hitInfo.Initiator is BaseHelicopter) { hitInfo.damageTypes = new DamageTypeList(); hitInfo.DidHit = false; hitInfo.HitEntity = null; hitInfo.Initiator = null; hitInfo.DoHitEffects = false; } }
-
oh I'm sorry, but I do not know what to do with it, will explain more in detail.
-
Well you can put this code in any of your installed plugin where doesn't already contain the function OnEntityTakeDamage or just adding
Code:if (entity is BuildingBlock && hitInfo.Initiator is BaseHelicopter) { hitInfo.damageTypes = new DamageTypeList(); hitInfo.DidHit = false; hitInfo.HitEntity = null; hitInfo.Initiator = null; hitInfo.DoHitEffects = false; }