Friendly Fire should be a consenting setup instead of non-consenting. In other words, both party members should have it turned on to take or give damage. This is just my recommendation, but this can avoid trolls. As it currently stands, if I turned on my friendly fire, I could damage a party member, but if they have it turned off they can't damage me. So they could be killed and not have a chance to defend themselves quickly.
private void OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info)
{
var helicopter = entity as BaseHelicopter;
if (helicopter != null && helicopter.net != null && info.InitiatorPlayer != null)
_lastHeli[helicopter.net.ID] = info.InitiatorPlayer;
var player = entity as BasePlayer;
if (player == null) return;
var initiatorPlayer = info.InitiatorPlayer;
if (initiatorPlayer == null || player == initiatorPlayer) return;
var data = GetPlayerData(player.userID);
if (data == null) return;
var initdata = GetPlayerData(initiatorPlayer.userID);
if (initdata == null) return;
var clan = FindClanByID(initiatorPlayer.userID);
if (clan == null) return;
if ((!data.FriendlyFire || !initdata.FriendlyFire) && clan.IsMember(player.userID))
{
info.damageTypes.ScaleAll(0);
Reply(player, CannotDamage);
}
if ((!data.AllyFriendlyFire || !initdata.AllyFriendlyFire)&& clan.Alliances.Select(FindClanByTag).Any(x => x.IsMember(player.userID)))
{
info.damageTypes.ScaleAll(0);
Reply(player, AllyCannotDamage);
}
}
These Lang options should also be updated.
[CannotDamage] = "Friendly fire is turned off, you are were not damaged. (<color=#7FFF00>/clan ff</color>)",
[AllyCannotDamage] = "Ally fire is turned off, you are were not damaged. (<color=#7FFF00>/clan allyff</color>)",