Raised This Month: $ Target: $400
 0% 

[TF2] PvP Opt-In


Post New Thread Reply   
 
Thread Tools Display Modes
Author
reBane
Senior Member
Join Date: May 2020
Plugin ID:
7877
Plugin Version:
23w08a
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    9 
    Plugin Description:
    If friendly isn't pacifist enough, make pvp opt-in
    Old 12-10-2021 , 15:35   [TF2] PvP Opt-In
    Reply With Quote #1

    PvP Opt In
    By default no pvp and pass through enemy team players.
    This plugin was written as alternative to /friendly plugins as players usually forgot to enable it or were unhappy with how collision groups mess up certain things like elevators. So hopefully by putting all that on it's head, there wont ever be the need to report for RDM again!

    Features:
    - Global PvP toggle
    - Pair PvP via invites, player can disable invites
    - Walk through enemies base on pvp state
    - Color players based on pvp state
    - Sentries and bots ignore non-pvp players
    - Fully translatable
    - Blocks various conditions between non-pvp players
    - Prevent players pushing eachother with e.g. loose cannon outside of pvp
    - Bosses and Skeleton ignore players that are not in PvP (see ConVars)
    - Generates a config at cfg/sourcemod/plugin.pvpoptin.cfg
    - Banning players from PvP

    Note on Supressing AI Targeting: Due to how the targeting for sentries and some bosses is implemented, supressing a player or entity from being targeted results in the sentry or boss not seeing any enemy and idling or entering a false positive state.

    ConVars:
    pvp_joinoverride "0"
    Define global PvP State when player joins.
    0 = Load player choice, 1 = Force out of PvP, -1 = Force enable PvP

    pvp_nocollide "1"
    Can be used to disable player collision between enemies.
    0 = Don't change, 1 = with global pvp disabled, 2 = never collied

    pvp_buildings_vs_zombies "2"
    Control sentry <-> skeleton targeting.
    Possible values: -1 = Fully ignore, even manual damage, 0 = Never target, 1 = Global PvP only, 2 = This is PvE so Always

    pvp_buildings_vs_bosses "2"
    Control sentry <-> boss targeting.
    Possible values: -1 = Fully ignore, even manual damage, 0 = Never target, 1 = Global PvP only, 2 = This is PvE so Always

    pvp_players_vs_zombies "1"
    Control player <-> skeleton targeting.
    Possible values: -1 = Fully ignore, even manual damage, 0 = Never target, 1 = Global PvP only, 2 = This is PvE so Always

    pvp_players_vs_bosses "1"
    Control player <-> boss targeting.
    Possible values: -1 = Fully ignore, even manual damage, 0 = Never target, 1 = Global PvP only, 2 = This is PvE so Always

    pvp_gamestates "all"
    The game states when this plugin should be active or all if it should always run. Following states are possible: all, waiting, pregame, running, overtime, suddendeath, gameover

    pvp_playertaint_enable "1"
    Can be used to disable player tainting based on pvp state

    pvp_playertaint_bluoff "255 255 225"
    Color for players on BLU with global PvP disabled.

    pvp_playertaint_bluon "255 125 125"
    Color for players on BLU with global PvP enabled.

    pvp_playertaint_redoff "255 255 225"
    Color for players on RED with global PvP disabled.

    pvp_playertaint_redon "125 125 255"
    Color for players on RED with global PvP enabled.

    For all colors for format is R G B A from 0 to 255 or web color #RRGGBBAA. Alpha is optional.

    pvp_playerparticle_enable "1"
    Play a particle on players that can be PvPed. Playes for both global and pair PvP.

    There is a really cool pvp inicator particle system in the clientmod/ directory, but due to how TF2 is not loading custom particle systems from the server, I can't use it. In case you want to take a look, I added some instructions on how to use the particle. Thanks to FancyNight and sigmarune for making that custom particle system

    pvp_spawnkill_protection "15 5 35 100 60"
    Set up spawn protection. Set to an empty value to disable. Parameters in order are: Minimum Penalty, Protection Time [s], Maximum Penalty, Threashold, Ban Time [m]

    pvp_toggle_action "0"
    Decides what to do when a player toggles global PvP. Set this convar to the sum of flags.
    Flags: 1 - Respawn when turning on, 2 - Kill when turning on, 4 - Respawn when turning off, 8 - Kill when turning off.
    If you set 1 or 2, the cooldown for leaving will not apply until the player was tagged by shooting or getting shot.

    Commands:
    /pvp
    Toggle global PvP on or off

    /pvp player
    Invite to, accept and end pair PvP with another player.
    If the player was not found, get a menu.

    /pvpinvite [player]
    Forces the pick player menu if no argument is given, haves like /pvp otherwise

    /stoppvp
    End pair PvP with all players.
    If no pair PvP running, toggle ignore state.

    /forcepvp <target|'map'> <0|1>
    Override the targets global pvp choice. If you use 'map' it will apply to all players joining the server. Non persistent (will reset on map change). Requires admin flag Slay.

    /mirror <target> <0|1>
    Force mirror damage on someone. Mirror damage only affects players that are not PvPing, and is only for fun.

    /mirrorme
    Mirror your damage agains non-PvP players.

    /banpvp <#userid|name> <minutes> [reason]
    Ban a player from PvP. Time has to be positive integer. (1440 is a day) If you omit minutes and reason, it will tell you whether the player is already banned.

    /unbanpvp <#userid|name>
    Unban a player from PvP

    New Target Selectors:
    - @pvp Select all players with global PvP enabled
    - @!pvp Select all players with global PvP enabled

    There's also a settings menu to toggle global PvP and pair PvP.

    Dependencies:
    Install the following required plugins:
    - CollisionHook
    - TF Utils
    - NativeVotes (Optional, Sappho's fork should be up to date)

    Note: DHooks was added to SM 1.11, you might not need to download it in the future.

    The CollisionHook branch I linked is prebuilt, but the gamedata might be outdate.
    Check this file, it should be up to date.

    If you want to compile the plugin you will need MoreColors

    Note: Two functions are borrowed from SMLib's transitional syntax branch (in utils.sp)

    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo

    Last edited by reBane; 03-08-2023 at 16:10. Reason: Update to 23w08a
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 12-28-2021 , 10:51   Re: [TF2] PvP Opt-In
    Reply With Quote #2

    Update to 21w52a:
    - Removed NOTARGETing as that broke more things than it was worth
    - Player VS AI flags for buildings, players, zombies and bosses
    These are split into 4 cvars, allowing fine control. The "buildings vs"-flags are a bit wonky due to find target
    - Added Detours for basic boss attacks (Headless Hatman, Merasmus, Monoculus)
    - Detour FoundTarget call for sentries to prevent attacking players, bosses and buildings
    This is a bit buggy as the turret is still set into a non-searching state, but i couldn't find a better way for non players/bots.
    - Fixed Sentries targeting other buildings incorrectly
    - Prevent buildings being damaged out of pvp
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 02-26-2022 , 10:34   Re: [TF2] PvP Opt-In
    Reply With Quote #3

    Update to 22w08a
    - Added Support for the Vehicles plugin
    - Added Support for NativeVotes
    - Added API for other plugins
    - Leaving PvP is now on a cooldown
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 03-01-2022 , 10:05   Re: [TF2] PvP Opt-In
    Reply With Quote #4

    Update to 22w09a:
    - Added particle effect for players in PvP visible on anyone in global or pair PvP.
    If particles cause problems, you can disable them trough the new convar.
    - Toggle off cooldown now resets on respawn to allow quicker exit from pvp after being killed on maps without spawnroom.
    Might move this to be reset on death if it is too troublesome.
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 03-04-2022 , 10:56   Re: [TF2] PvP Opt-In
    Reply With Quote #5

    Update to 22w09b:
    - Improved particle handling
    - There is now a custom pvp indicator particle system, that is unused.
    You simply cannot expect players to install a client mod for a single particle system.
    Thanks to FancyNight and sigmarune for making the particle tho
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 04-07-2022 , 14:58   Re: [TF2] PvP Opt-In
    Reply With Quote #6

    Update to 22w14a:
    - Changed the event order for the PvP check.
    This should allow changes from other plugins, that modify damage sources/etc, to be picked up by this plugin (more easily)
    - Fixed PvP Particle not playing for spies
    - Fixed hitscan damage while the plugin is inactive (gamestates) by disabling the collision hooks
    - Mirror and taunt damage bypasses now have higher priority (now also mirror/whitelist when in pvp with the target)
    - Added primitive ban system
    Note: The translation file changed - Either sm_reload_translations or change map when updating!
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo

    Last edited by reBane; 04-07-2022 at 14:58.
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 06-23-2022 , 10:41   Re: [TF2] PvP Opt-In
    Reply With Quote #7

    Update to 22w25a:
    - Fixed toggling global PvP through /settings not triggering cooldown
    - Added pvp_toggle_action to punish players for toggling if neccessary
    - Added sm_pvpinvite to force open the invite menu if you can't type someones nick
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 12-02-2022 , 13:23   Re: [TF2] PvP Opt-In
    Reply With Quote #8

    Update to 22w48a
    * Updated gamedata to TF2-2022-12-02, Thank you nosoop
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 12-24-2022 , 20:29   Re: [TF2] PvP Opt-In
    Reply With Quote #9

    Update to 22w51a:
    - Cursader Crowssbow no longer heals across global PvP boundaries
    - Using a vanity model (no head attachment = assuming the model has no proper hitboxes) will lock players out of global PvP. This mainly affects Model Manager.

    Note: GameData and Translation file changed!
    __________________
    Plugins & LibrariesListing GitHubDosMike Tools ▶ ToDo
    reBane is offline
    BreadTeleporter
    New Member
    Join Date: Feb 2023
    Old 02-12-2023 , 15:41   NativeVote eror in the plugin
    Reply With Quote #10

    When I try to run the plugin, I get this error

    [SM] Plugin pvpoptin.smx failed to reload: Native "NativeVote.SetTitle" was not found.

    I am using the latest version of this plugin and NativeVote.
    Do I need to use an older version?
    BreadTeleporter is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 20:34.


    Powered by vBulletin®
    Copyright ©2000 - 2023, vBulletin Solutions, Inc.
    Theme made by Freecode