1. So I run a stupidly modded server and C4 is candy on my server. I want a way to make foundations only indestructable if built in a TC raidus... but if you have building perms you can C4/Rocket the foundations.

    I want people to actually have to raid a base instead of just leveling it every time. More and more players are just building wide 3 story bases instead of taller bases.

    Basically the addon would be to look at the TC if you have building privlidge then you can destroy foundations, if not then foundations take no damage.
     
  2. hello,

    Something like this should work, if @Wulf can confirm

    Code:
            private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo)
            {
                if (entity == null || hitInfo == null)
                    return;            if (entity is BuildingBlock)
                {
                    BuildingBlock block = entity as BuildingBlock;
                    if (hitInfo.Initiator == null) return;
                    BasePlayer attacker = hitInfo.Initiator.ToPlayer();
                    if (attacker == null) return;
                    if (block.LookupPrefab().name.Contains("foundation") && hasBuildingPrivileges(attacker))
                    {
                        hitInfo.damageTypes = new DamageTypeList();
                        hitInfo.DoHitEffects = false;
                        hitInfo.HitMaterial = 0;
                    }
                }
            }
               static bool hasBuildingPrivileges(BasePlayer player)
               {
                   return player.HasPlayerFlag(BasePlayer.PlayerFlags.HasBuildingPrivilege);
               }
    
     
  3. @sami37 If this will work would you make it into a completed addon for me?