AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Smarter Spawns - Spawn Protection (https://forums.alliedmods.net/showthread.php?t=185409)

DarthNinja 05-17-2012 00:33

[TF2] Smarter Spawns - Spawn Protection
 
2 Attachment(s)
[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

Snaggle 05-17-2012 00:38

Re: [TF2] Smarter Spawns - Spawn Protection
 
Clever idea, nice one.

Leonardo 05-17-2012 01:06

Re: [TF2] Smarter Spawns - Spawn Protection
 
how people says...
+karma

Grot 05-17-2012 02:06

Re: [TF2] Smarter Spawns - Spawn Protection
 
As the person who asked DarthNinja for this, thank you so very much.

serpentine 05-17-2012 02:08

Re: [TF2] Smarter Spawns - Spawn Protection
 
Should help a lot of people that have rules against spawn camping, nice.

xomp 05-17-2012 17:54

Re: [TF2] Smarter Spawns - Spawn Protection
 
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!

Mr. Man 05-31-2012 18:13

Re: [TF2] Smarter Spawns - Spawn Protection
 
Quote:

Originally Posted by serpentine (Post 1710454)
Should help a lot of people that have rules against spawn camping, nice.

Has always been a problem for my server.

Powerlord 06-01-2012 01:32

Re: [TF2] Smarter Spawns - Spawn Protection
 
So, we're trying to fix the design of Dustbowl now rather than just not playing it? :P

Grot 06-03-2012 20:45

Re: [TF2] Smarter Spawns - Spawn Protection
 
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;
}

DarthNinja 06-09-2012 03:50

Re: [TF2] Smarter Spawns - Spawn Protection
 
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



All times are GMT -4. The time now is 00:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.