The following license is placed inside the source code of the plugin.
No Friendly-Fire: a L4D/L4D2 SourceMod Plugin Copyright (C) 2022 Alfred "Psyk0tik" Llagas
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Disables friendly-fire.
cravenge - For the original source code; fixing all the errors and converting the original source code into the new syntax in this post.
Lux/LuxLuma - For the previous source code; showed me a better and simpler way of handling friendly fire.
Silvers (Silvershot) - For the code that allows users to enable/disable the plugin in certain game modes and for blocking damage after idle/spectator team change and player disconnects.
Kr3m, WhatsAnName - For reporting an issue.
SourceMod Team - For continually updating/improving SourceMod
.
SourceMod 1.9
or higher- Recommended: [L4D & L4D2] Explosive Chains Credit
- Recommended: [L4D & L4D2] Left 4 DHooks Direct
- I do not provide support for listen/local servers but the plugin should still work properly on them.
- I will not help you with installing or troubleshooting problems on your part.
- If you get errors from SourceMod itself, that is your problem, not mine.
- MAKE SURE YOU MEET ALL THE REQUIREMENTS AND FOLLOW THE INSTALLATION GUIDE PROPERLY.
- Block friendly-fire for survivors.
- Block friendly-fire for special infected.
- Filter which damage types to allow/block.
// Block explosive damage?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_blockexplosions "1"
// Block fire damage?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_blockfires "1"
// Block bullet damage?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_blockguns "1"
// Block melee damage?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_blockmelee "1"
// Disable the No Friendly-Fire in these game modes.
// Game mode limit: 16
// Character limit for each game mode: 32
// Empty: None
// Not empty: Disabled in these game modes.
// -
// Default: ""
nff_disabledgamemodes ""
// Enable the plugin?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_enable "1"
// Enable the No Friendly-Fire in these game modes.
// Game mode limit: 16
// Character limit for each game mode: 32
// Empty: None
// Not empty: Enabled in these game modes.
// -
// Default: ""
nff_enabledgamemodes ""
// Enable the No Friendly-Fire in these game mode types.
// 0 OR 15: ALL
// 1: Co-op
// 2: Versus
// 3: Survival
// 4: Scavenge
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "15.000000"
nff_gamemodetypes "0"
// Disable Infected team friendly-fire?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_infected "1"
// Only block friendly-fire when all survivors are still inside the saferoom.
// Requires "Left 4 DHooks Direct": https://forums.alliedmods.net/showthread.php?t=321696
// 0: OFF
// 1: ON
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_saferoomonly "0"
// Disable Survivors team friendly-fire?
// 0: OFF
// 1: ON
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
nff_survivors "1"
- Delete files from old versions of the plugin.
- Place
no_friendly-fire.smx
in theaddons/sourcemod/plugins
folder. - Place
no_friendly-fire.sp
in theaddons/sourcemod/scripting
folder.
- Delete
no_friendly-fire.sp
from theaddons/sourcemod/scripting
folder. - Delete
no_friendly-fire.smx
from theaddons/sourcemod/plugins
folder. - Follow the Installation guide above. (Only for upgrading to newer versions.)
- Move
no_friendly-fire.smx
to theplugins/disabled
folder. - Unload
No Friendly-Fire
by typingsm plugins unload no_friendly-fire
in the server console.
If you have any questions that aren't addressed below, feel free to message me or post on this thread.
- How do I enable/disable the plugin in certain game modes?
You must specify the game modes in the nff_enabledgamemodes
and nff_disabledgamemodes
convars.
Here are some scenarios and their outcomes:
- Scenario 1
nff_gamemodetypes "0" // The plugin is enabled in all game mode types.
nff_enabledgamemodes "" // The plugin is enabled in all game modes.
nff_disabledgamemodes "coop" // The plugin is disabled in "coop" mode.
Outcome: The plugin works in every game mode except "coop" mode.
- Scenario 2
nff_gamemodetypes "1" // The plugin is enabled in every Campaign-based game mode.
nff_enabledgamemodes "coop" // The plugin is enabled in only "coop" mode.
nff_disabledgamemodes "" // The plugin is not disabled in any game modes.
Outcome: The plugin works only in "coop" mode.
- Scenario 3
nff_gamemodetypes "5" // The plugin is enabled in every Campaign-based and Survival-based game mode.
nff_enabledgamemodes "coop,versus" // The plugin is enabled in only "coop" and "versus" mode.
nff_disabledgamemodes "coop" // The plugin is disabled in "coop" mode.
Outcome: The plugin works only in "coop" mode.
If you would like to share your own revisions of this plugin, please rename the files so that there is no confusion for users.
Enjoy all my hard work and have fun with it!