Jump to content

Friendly Fire Adjustment

Closed 1.0.19 1.0.20

RedAcid
  • in Clans
RedAcid

Posted (edited)

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>)",

Edited by RedAcid
Mevent

Posted

Changed Status from Pending to Closed

Changed Fixed In to 1.0.20

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.