PDA

View Full Version : Spawn Protection


CrimsonGT
04-01-2008, 01:16
This plugin was a request on the Sourcemod forums for Surf Maps to prevent spawn killing. Useful for surf maps, deathmatch maps, and maps where players spawning positions are vulnerable to attack.

Commands:
sm_spawnprotect_enable - Toggle Spawn Protection (Def: 1)
sm_spawnprotect_announce - Toggle Announcements when Spawn Protection wears off. (Def: 1)
sm_spawnprotect_timer - Time in Seconds After Spawning the Protection will wear off. (Def: 10)Installation:
Copy SpawnProtection.smx to your SourceMod plugins directory
Set the three Cvar commands above in your server.cfg file as you wish if you do not want to keep them as default.To Do List:
Add animation to players who currently have spawn protection.

Rebell
04-01-2008, 02:21
Nice but doesnt this plugins do not the same ?

-> http://forums.alliedmods.net/showthread.php?t=65094

-> http://forums.alliedmods.net/showthread.php?t=60002

cya

CrimsonGT
04-01-2008, 03:51
Guess it does, the guy who requested it said he couldn't find one that worked in TF2.

Shift
04-01-2008, 08:04
great thanks !!!!!!
it is WORK !!!!!!
!!!!!!

CrimsonGT
04-01-2008, 13:52
o_O Your welcome.

Private Dyin
04-04-2008, 05:11
Guess it does, the guy who requested it said he couldn't find one that worked in TF2.

Though untested this plugin apparently supports TF2 and it looks like it does the exact same thing as yours.

http://forums.alliedmods.net/showthread.php?t=68139

CrimsonGT
04-05-2008, 08:22
Great, I get the point that I made a plugin that others have already made because I figured the requester had done a search. Please remind me to go hunt down a massive amount of links and chase you down next time you post something thats been said or done before.

Electric Warrior
04-05-2008, 15:12
Thanks for your work CrimsonGT, don't get disheartened, some people are just ungrateful.

Electric Warrior
04-06-2008, 02:31
Totally in the wrong context, but hey, never mind eh? You'll get over it. :)

CrimsonGT
04-06-2008, 11:23
Not so much, I am trying to get better at writing sourcemod plugins and this was just an oppurtunity to put what i've learned to use for someone besides myself.

Furrydog
04-07-2008, 07:45
Guess it does, the guy who requested it said he couldn't find one that worked in TF2.

I know this may be considered and old wound but when I search the forums for spawn or protection this is the only plugin that comes up. I've downloaded and use it.... Thanks CrimsonGT

CrimsonGT
04-07-2008, 12:16
lol np. I haven't heard anyone else mention it, but I have a lot of trouble with the forum search. I searched all Sourcemod forums for things and it doesnt return anything. Its especially annoying that it doesnt look inside of the [code] blocks.

Fredd
04-07-2008, 18:07
you guys need some serious help then... (http://www.sourcemod.net/plugins.php?description=spawn&search=1)

CrimsonGT
04-08-2008, 06:26
Talking about the forum search you jackass.

Extreme_One
04-08-2008, 07:10
Talking about the forum search you jackass.


Forum search seems fine (http://forums.alliedmods.net/search.php?searchid=1972894) to me :mrgreen:

pantho
05-04-2008, 14:03
Thx Crimson :)

I tried the ServerDefense one, it worked fine for CSS, but for TF2 they stay protected for a unknown period. i turned the mod off after 2 minutes because people was still protected, (was set to 5 seconds)

Anyways, this is perfect and simple. Does the job i ask, and it does it well.

Maybe add a color for protection, 50% alpha maybe

(PS, this is also better than ServerDefense as it just does the spawn protection, ServerDefense comes with unwanted extras :))

menotyou
08-10-2008, 00:01
this work on dod:s O/B

ljprevo
08-16-2008, 22:59
There is a problem with this plugin, if a player throws a nade in spawn and stays in spawn during protection time it crashes and resets the server.

Lord Max
08-17-2008, 16:44
Hey,

I just want to say, this is one hell of a plugin. I've been trying to get some other TF2 Spawn Protection plugins working, but they are too complicated.

I like this because it a plain, simple and very easy to use plugin. I would recommend this to anyone who would like a Spawn Protection plugin for TF2.

Thanks alot CrimsonGT,

Lord Max

GrossKopf
10-13-2008, 10:44
Thanks for making this plugin. Works great! I have it installed on my server!

pit
10-15-2008, 07:07
Hi,

I've put this plugin on Insurgency and it seems ok.

I've got one issue : the respawn time is always 5 seconds, it's a bit short...

I've try to set sm_spawnprotect_timer 10 or more but it remains on 5 seconds protection.

CrimsonGT
10-15-2008, 14:41
Honestly, not a clue as far as insurgency goes. I made it as generic as possible so as many mods could use it as possible. However, with these non valve made mods, some of them are a bit different. If anyone does any coding for Insurgency that wants to give me an idea, I will try and get that cvar to work for that game as well.

pit
11-15-2008, 13:07
My fault, it works. I had to set the protection time in server.cfg file, not in the sourcemod plugin config file.

sLuGo
11-18-2008, 07:14
Updated Insurgency server. Sourcemod snapshot 1.1.0-dev

This error is crashing my server(usually full :\)Really like the plugin, please let me know if i can do anything to help get it back to stable.

L 11/17/2008 - 23:37:13: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/17/2008 - 23:37:13: [SM] [0] Line 69, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:42: Error log file session closed.
L 11/18/2008 - 00:00:43: SourceMod error session started
L 11/18/2008 - 00:00:43: Info (map "ins_sinjar") (file "errors_20081118.log")
L 11/18/2008 - 00:00:43: [SM] Native "GetClientHealth" reported: Client 11 is not in game
L 11/18/2008 - 00:00:43: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/18/2008 - 00:00:43: [SM] [0] Line 59, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:43: [SM] Native "GetClientHealth" reported: Client 4 is not in game
L 11/18/2008 - 00:00:43: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/18/2008 - 00:00:43: [SM] [0] Line 59, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:43: [SM] Native "GetClientHealth" reported: Client 14 is not in game
L 11/18/2008 - 00:00:43: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/18/2008 - 00:00:43: [SM] [0] Line 59, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:43: [SM] Native "GetClientHealth" reported: Client 18 is not in game
L 11/18/2008 - 00:00:43: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/18/2008 - 00:00:43: [SM] [0] Line 59, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:43: [SM] Native "GetClientHealth" reported: Client 5 is not in game
L 11/18/2008 - 00:00:43: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/18/2008 - 00:00:43: [SM] [0] Line 59, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:43: [SM] Native "GetClientHealth" reported: Client 17 is not in game
L 11/18/2008 - 00:00:43: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 11/18/2008 - 00:00:43: [SM] [0] Line 59, /home/groups/alliedmodders/forums/files/3/1/7/8/4/25192.attach::(null)()
L 11/18/2008 - 00:00:43: [SM] Native "GetEntDataEnt2" reported: Entity 17 is invalid


this usually results(after awhile) in the memory dump

CrimsonGT
12-03-2008, 18:25
Sorry for the delay. I went ahead and added an update to fix these errors, so it should work fine for you now.

abelp
12-03-2008, 19:06
I see you have announcer 1/0 cvar. That's awesome.

znollen
01-30-2009, 11:19
I have this error on mig server now and i have SM 1.1 and MM 1.7.0

L 01/29/2009 - 22:26:23: SourceMod error session started
L 01/29/2009 - 22:26:23: Info (map "dod_orange_nvr_arena") (file "errors_20090129.log")
L 01/29/2009 - 22:26:23: [SM] Native "GetClientHealth" reported: Client 8 is not in game
L 01/29/2009 - 22:26:23: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 01/29/2009 - 22:26:23: [SM]
Line 59, /home/groups/sourcemod/upload_tmp/phpbE36ov.sp::timer_GetHealth()L 01/29/2009 - 22:26:23: [SM] Native "GetPlayerWeaponSlot" reported: Client 8 is not in game
L 01/29/2009 - 22:26:23: [SM] Displaying call stack trace for plugin "dod_gungame.smx":
L 01/29/2009 - 22:26:23: [SM]
Line 244, /home/groups/sourcemod/upload_tmp/phpgvC5aY.sp::Timer_Strip()L 01/29/2009 - 22:26:35: Error log file session closed.

CrimsonGT
01-30-2009, 22:55
Okay, I updated it. Shouldnt get that error anymore.

bolinux
02-06-2009, 22:13
Im geting this error:


L 02/07/2009 - 04:07:15: [SM] Native "PrintToChat" reported: Client 1 is not in game
L 02/07/2009 - 04:07:15: [SM] Displaying call stack trace for plugin "spawnprotection.smx":
L 02/07/2009 - 04:07:15: [SM] [0] Line 72, C:\Users\blabla\Desktop\spawnprotection.sp::t imer_PlayerProtect()


MM 1.7 SM 1.2 SVN

Blowin.oO
03-16-2009, 19:14
does this work for dod:S?

CrimsonGT
03-16-2009, 22:04
does this work for dod:S?

According to Game-Monitor quite a few DoDS servers are running it so it shouldnt have a problem.

http://www.game-monitor.com/search.php?search=sm_spawnprotect_version&type=variable

Lchriaz
03-19-2009, 23:56
hey, That work for .amxx ?

Cya

Dragonshadow
04-09-2009, 11:53
Does this work for tf2?

CrimsonGT
04-09-2009, 13:13
Yes

rodregis
04-27-2009, 10:52
This plugin works great on my zombie riot server apart from the fact that the zombies get it too.

Any chance you could make it so that we can choose so only CT or T's get the protection.

Or possibly just two cvars to allow individual spawn timer lengths for each side?

Remy Lebeau
12-07-2009, 00:40
Hi,

Is there a reason why it is limited to 30 seconds for spawn protection? Could you modify it to be unlimited?

I'm trying to use this mod to give everyone on the server God mode. I want to setup a "pro" surf server, and need a mod so that people don't kill, only surf... this would work fine (I want to set spawn protection for the duration of the map time...), except that it's limited to 30 secs...

Remy Lebeau
12-07-2009, 01:50
Never mind, I edited it + recompiled myself :-) Made the limit 4800 seconds.

Plaguefest
01-09-2010, 21:08
This plugin works great on my zombie riot server apart from the fact that the zombies get it too.

Any chance you could make it so that we can choose so only CT or T's get the protection.

Or possibly just two cvars to allow individual spawn timer lengths for each side?

this +

Thalion
02-06-2010, 16:19
Please make this so people will be a certain color/opacity when they are spawn protected! I like this one out of all spawn protection plugins!!

Malak101
03-07-2010, 11:39
I am running this plugin on my CSS server but I keep getting this in my error logs.

L 03/07/2010 - 16:19:13: [SM] Native "PrintToChat" reported: Client 6 is not in game
L 03/07/2010 - 16:19:13: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 03/07/2010 - 16:19:13: [SM] [0] Line 72, /home/groups/alliedmodders/forums/files/3/1/7/8/4/36454.attach::timer_PlayerProtect()
L 03/07/2010 - 16:19:15: [SM] Native "PrintToChat" reported: Client 3 is not in game
L 03/07/2010 - 16:19:15: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 03/07/2010 - 16:19:15: [SM] [0] Line 72, /home/groups/alliedmodders/forums/files/3/1/7/8/4/36454.attach::timer_PlayerProtect()
L 03/07/2010 - 16:19:16: [SM] Native "PrintToChat" reported: Client 5 is not in game
L 03/07/2010 - 16:19:16: [SM] Displaying call stack trace for plugin "SpawnProtection.smx":
L 03/07/2010 - 16:19:16: [SM] [0] Line 72, /home/groups/alliedmodders/forums/files/3/1/7/8/4/36454.attach::timer_PlayerProtect()Could someone please explain what this means because this could be part of the reason why my server randomly crashes sometimes.

Cooltad
03-07-2010, 12:15
Probably doesn't cause any crashes, use "if (IsClientInGame(client))" on the line it's talking about.

Malak101
03-07-2010, 13:03
L 03/07/2010 - 16:19:15: [SM] [0] Line 72, /home/groups/alliedmodders/forums/files/3/1/7/8/4/36454.attach::timer_PlayerProtect()

Probably doesn't cause any crashes, use "if (IsClientInGame(client))" on the line it's talking about.

I searched "timer_PlayerProtect" in SpawnProtection.sp and found these 2:

CreateTimer(GetConVarFloat(cvarProtectTime), timer_PlayerProtect, client);
public Action:timer_PlayerProtect(Handle:timer, any:client)Could you please be more exact about where the changes should be made?

turk89
07-15-2010, 22:44
Edit: Problem solved.

friagram
09-12-2012, 15:40
This plugin causes crashes - and infinite timer loops/leaks, esp. if you disable the plugin, and load a new map, it will continue to loop forever. It's better to remove the timer restore health loops/hooks, and just make it edit the player's entity to make them take no damage. When protection expires, edit the entity again so that they take damage. This also prevents enemy players from doing things like charging up buff banner/mmmmpf in tf2.

Wazman
12-17-2012, 15:21
Hey, Is there a way you can make it so that you can set the protection on a specific Team.

luki1412
06-28-2013, 19:04
Hello guys, I thought that someone might want this version so Im posting it here.

Error PrintToChat should be fixed and I have also added red/blue glow on spawn protected players. I have tested this on tf2 and its working well.

EDIT: Changed colors to orange/light blue on protected players. Fixed bug where you use "Spy!" voice command on someone and it will play sound that spy is around. It will still not work when players are colored.

EDIT2: Removed unnecessary checks. Fixed an error, being spammed in the console/logs.

EDIT3: Added some checks to ignore client 0, fixed some typos and updated some code.

maxolahird
04-11-2014, 09:20
Please crymsom this still do damage even if not having effect on target... for example if my attack has freezing skills it does freeze him even when protected x.x

SM9
05-25-2014, 18:48
You should NOT be setting a timer directly on a client, instead you should parse his userid. If that client disconnects while the timer is still running its going to hook itself to any other client that takes his index. For this reason I'm surprised its even approved.

I have fixed the errors and also made the messages less spammy.