https://forums.alliedmods.net/showthread.php?t=335513
The Plug-in Itself
https://github.com/DosMike/TF2-PvP-OptIn
Because to the constant complaining about "tryharding," and people refuse to use !friendly to stop being killed, i have found this handy plugin. This plug-in is a solution that satisfies everyone. It disables PVP globally, and if people want to fight, they can enable it for themselves and only attack people who have also enabled it. If you're dueling someone, you can create a pair and only hurt the other person in that pair.
I would only recommend looking into this plugin, as it would satisfy the needs of the player base, who are mostly friendly.