Raised This Month: $182 Target: $400
 45% 

[TF2] Smarter Spawns - Spawn Protection


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
2956
Plugin Version:
1.0.1
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    44 
    Plugin Description:
    Reduces damage done to players in spawns without using godmode.
    Old 05-17-2012 , 00:33   [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #1

    [TF2] Smarter Spawns
    Version 1.0.1


    Description:
    Players in spawns who are being attacked from outside of spawn will take reduced damage.
    Players outside spawn being attacked from players inside spawn will also take reduced damage.
    Damage scaling is configurable and can also be increased instead of reduced.
    Cvars:
    • smarter_spawns
      • Plugin Version
    • smarter_spawns_damage_inspawn
      • The damage percentage players inside spawn will take from players outside.
      • Min: 0.0
      • Max: 2.0
      • Default: 0.25 (or 25% of total damage)
    • smarter_spawns_damage_outsidespawn
      • The damage percentage players outside spawn will take from players inside.
      • Min: 0.0
      • Max: 2.0
      • Default: 0.50 (or 50% of total damage)

    Install Instructions:

    1. Place SmarterSpawns.smx into your addons/sourcemod/plugins/ folder.


    Notes:
    This plugin uses the func_respawnroom entity to detect if a player is inside or outside of spawn. If your map doesn't have them or is sloppy with them, it's your problem. Don't whine when it doesn't do anything.
    Requires SDKHooks and will not compile on the forums. Grab the .smx or compile it yourself.

    Version History:
    • V1.0.0
      • Initial Release
    • V1.0.1
      • Minor optimizations
    Total downloads as prior to last edit: 2
    Attached Files
    File Type: smx SmarterSpawns.smx (4.2 KB, 739 views)
    File Type: sp Get Plugin or Get Source (SmarterSpawns.sp - 384 views - 4.8 KB)
    __________________

    Last edited by DarthNinja; 05-17-2012 at 01:46.
    DarthNinja is offline
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 05-17-2012 , 00:38   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #2

    Clever idea, nice one.
    Snaggle is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: Soviet Union
    Old 05-17-2012 , 01:06   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #3

    how people says...
    +karma
    Leonardo is offline
    Grot
    Member
    Join Date: May 2012
    Old 05-17-2012 , 02:06   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #4

    As the person who asked DarthNinja for this, thank you so very much.
    Grot is offline
    serpentine
    I don't have a problem
    Join Date: Feb 2011
    Location: Madison, WI
    Old 05-17-2012 , 02:08   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #5

    Should help a lot of people that have rules against spawn camping, nice.
    __________________
    serpentine is offline
    xomp
    BANNED
    Join Date: Jul 2008
    Old 05-17-2012 , 17:54   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #6

    Cool, I find it incredibly unfair when those in spawn have unlimited health/ammo protection by door and such. This plugin shou.... hey... wait a minute!
    xomp is offline
    Send a message via Skype™ to xomp
    Mr. Man
    Veteran Member
    Join Date: Mar 2011
    Location: Huh?
    Old 05-31-2012 , 18:13   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #7

    Quote:
    Originally Posted by serpentine View Post
    Should help a lot of people that have rules against spawn camping, nice.
    Has always been a problem for my server.
    Mr. Man is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 06-01-2012 , 01:32   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #8

    So, we're trying to fix the design of Dustbowl now rather than just not playing it?
    __________________
    So long and thanks for all the fish.
    Powerlord is offline
    Grot
    Member
    Join Date: May 2012
    Old 06-03-2012 , 20:45   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #9

    I have a small Request/Suggestion. Could you add in the functionality to disallow hurting other players inside a func_respawnroom while you are also in a func_respawn room? I know you commented in the source it was not needed, but two of my friends asked me if this was an option. They want run a trade server with friendly fire on but not have it just be a spawn bloodbath. It would also help for those trade maps like trade_plaza where you can snipe spawn to spawn.

    I actually had a go myself, just adding this to it, but it prevents even self-damage in spawn and I have not the skills to fix it.

    Quote:
    if (IsInSpawn[victim] && IsInSpawn[attacker])
    {
    if (g_fDamageOutsideSpawn == 0.0)
    damage = 0.0;
    else
    damage = damage * g_fDamageOutsideSpawn;
    return Plugin_Changed;
    }

    Last edited by Grot; 06-03-2012 at 20:46.
    Grot is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 06-09-2012 , 03:50   Re: [TF2] Smarter Spawns - Spawn Protection
    Reply With Quote #10

    That's because the attacker and the victim are the same player and are therefore both in the spawn.

    Change:
    PHP Code:
    if (IsInSpawn[victim] && IsInSpawn[attacker]) 
    To:
    PHP Code:
    if (IsInSpawn[victim] && IsInSpawn[attacker] && victim != attacker
    __________________
    DarthNinja 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 09:12.


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