Friendly-Fire Limit (1.1.1)
This plugin limits friendly-fire damage for Survivors and includes important features for servers. Unlike other plugins, this allows you to keep friendly-fire enabled on your server and set a FF cap per player in case someone trys to grief mid-game.
- Friendly-Fire is always disabled in the saferoom. In addition, you can limit the amount of FF damage a player can deal, or remove friendly-fire from an entire map.
- When a Friendly-Fire limit is set, any FF damage that a player does above that limit is ignored.
- You can limit the amount of FF that a player can deal to his Team (l4d_ff_limit) and each Teammate (l4d_ff_teammate).
- You can limit the amount of FF damage from Grenades/Fire, with both a "soft cap" and "hard cap".
- You can choose to notify admins when a player reaches the FF limit and/or ban the player automatically (Admin immune). Supports SourceBans.
- Option to log notifications and bans.
- Option to Announce FF Status to players (Survivors only).
- Works in Coop, Versus, and custom maps.
- l4d_ff_limit must be set to 40 or higher in order to ban with FF damage dealt to Team.
- l4d_ff_teammate must be set to 30 or higher in order to ban with damage dealt to a Teammate.
- l4d_ff_limit.cfg is executed on each map change, so any changes made ingame will be cleared. You may add map specific Limit settings to your server's map configs.
- I will not add a kick feature because the player could rejoin the server and grief all over again. You should use a short ban duration (5-10 minutes) if you want to use it as a kick feature.
- I will not add notification for the player when they have reached the FF limit. This is to prevent players from autoshotgun spamming pounced victims once they know they can no longer hurt their team.
l4d_ff_limit 60 // -1 = Block All Damage (full map), 0 = Block All Damage (saferoom only), any other = Player can deal this much damage to his entire Team.
l4d_ff_teammate 30 // (limit > 0) Player can deal this much damage to each teammate.
l4d_ff_grendmg_min 20 // (limit > 0) Grenade or Fire damage above this value will still hurt, but will not count against the player's FF limit. any value = Only count this much grendmg, -1 = infinite.
l4d_ff_grendmg_max_team 40 // (limit > 0) Player can deal this much Grenade or Fire damage to Team before the damage is prevented. 0 = infinite.
l4d_ff_grendmg_max_teammate 15 // (limit > 0) Player can deal this much Grenade or Fire damage to Teammate before the damage is prevented. 0 = infinite.
l4d_ff_ban 0 // 0 = no action, 1 = Ban only if player reaches Team FF limit (limit = 40+), 2 = Ban whichever comes first (limit = 40+) or (teammate = 30+). Use negative values if you require ban by IP address.
l4d_ff_banduration 0 // (ban > 0) Ban Duration in minutes. 0 = Don't ban but warn the player if they may be permbanned.
l4d_ff_permban_x 3 // Valid between 2 to 5. A value of 2 will permanently ban the player on their 2nd offense, etc.
l4d_ff_permban_y 30 // (ban > 0) Only count the number of times the player was warned/banned within this many days. 0 = don't perm ban, any other = number of days.
l4d_ff_log 1 // Log players that are banned or reach the FF limit (FriendlyFire.log). 0 = Disable, 1 = Enable.
l4d_ff_notify 1 // Notification when players reach the FF limit. 1 = Notify Admins.
l4d_ff_announce 1 // For Survivors only. 0 = Don't Announce, 1 = Announce Active/Inactive Status (limit = 0) or Announce Limit (limit > 0)
Players will now be logged when they receive a permban warning.
Fix a player who is warned instead of being banned will no longer have their damage reset.
Fix admins will no longer be notified that a player has reached the FF limit while the player is being banned.
Expert difficulty, (if greater than 0) l4d_ff_limit will be set to 0 (saferoom only) and l4d_ff_teammate will be disabled automatically.
Advanced difficulty, (if greater than 0) l4d_ff_limit and l4d_ff_teammate will be multiplied by 4.5, and l4d_ff_grenmin will be multilpied by 2.
Add cvars l4d_ff_permban_x and l4d_ff_permban_y, X number of bans allowed within Y days until a player is permanently banned.
If ban duration is set to 0, and l4d_ff_ban is set to 1 or 2, and l4d_ff_permban_y is greater than 0 Days, a player will recieve a warning instead of being banned. The player will be permanently banned once they reach l4d_ff_permban_x warnings/bans.
Fix bug in 1.0.7 causing missing name in chat when player is banned.
Add ability to ban by IP address instead of clientID, by entering negative l4d_ff_ban values.
Admins are immune if they have any of the following flags "abcdfz"
Fix accidentally banning admins after rewriting the code in 1.0.4.
Fix grenade damage can now be dealt to a player after reaching the Teammate FF limit, as long as the damage is above grendmg_min (where damage will not be counted as FF) and below grendmg_max.
Add l4d_ff_grendmg_min = -1 (infinite).
Fix bug when l4d_ff_grendmg_min = 0 (do not count as FF).
Add cvar l4d_ff_grendmg_min, Grenade or Fire damage above this value will still hurt, but will not count against the player's FF limit.
Add cvar l4d_ff_grendmg_max_team, a player can deal this much Grenade or Fire damage to Team before the damage is prevented.
Add cvar l4d_ff_grendmg_max_teammate, a player can deal this much Grenade or Fire damage to Teammate before the damage is prevented.
Damage to incapacitated players will no longer count towards FF limit, and will deal the normal damage.
Add cvar l4d_ff_teammate, limit max FF that can be dealt to a teammate.
Add cvar l4d_ff_ban, ban method.
Add: player's steamid is now logged.
Improved Coop detection of player left saferoom.
Fix bug when a player that has gone over the limit could sometimes heal a teammate with FF damage.
Add support for SourceBans.
Original concept by r5053
Big Thanks to Testers: Number Six
Requires: SM 1.2