PDA

View Full Version : Server Defense 2.1


Greyscale
12-31-2007, 19:29
Server Defense
Version 2.1

Requirements:

Sourcemod rev 1854+
Description:


This plugin defends against some common server problems such as spawn killing and camping. All features can be easily disabled if you don't want it on. Spawn killing is prevented by simply blocking the damage from happening, protected players will be a different color. They will be protected for a length of time and/or until they travel outside of 'x' feet from their spawn. The anti-camp module is completely customisable, you can change how long the player has to be camping to begin punishment, the severity of the punishment, and much more. The new integration into the SourceMod menu to enable or disable any features easily while in-game enhances the ease-of-use of this plugin.



Todo:
Mostly anything you suggest!

Installation:

Extract the contents of the zip file into your game's directory (CSS is "cstrike", DoD:s is "dods", etc)
Install serverdefense.phrases.txt in sourcemod/translations/ (download right under .zip file link)
Navigate to <yourgamedir>/cfg/sourcemod/serverdefense.cfg and configure the server defense options
Download and install serverdefense_menu.smx to sourcemod/plugins/serverdefense/ for admin menu integration
Your done!Changelog:

December 31st 2007
ReleasedJanuary 4th

Added anti-camp
Added color to protected players
Added afk detection
Notification of protection and mortality to spawning playersJanuary 6th

Changed variable prefixes to sd_
Added admin menu integration plugin to downloadJanuary 8th

Fixed attempt to end spawn protection on players that leave in the middle of it
Fixed invalid timer errors on map start with re-connecting players
Added mode '2' to sd_afk_punishment that kicks reg players but spectates admins
Spawn protection should now work in all modsJanuary 13th

Fixed never-ending spawn protection (thanks remercy)January 13th

Replaced depreciated functions, replaced old code with new SM stocks
Alpha now works in spawn protection (it didn't before), and I believe it should work right in TF2 now
Fixed never-ending loop of joining/kicking bots when afk protection was enabledJanuary 18th

Removed AFK module, there are plenty of other plugins to use for that, this one was pretty half-assed too.
Removed AFK toggle from the SM menu (so don't forget to update that)
Tried to fix HP bug for TF2, Bahamut, do you mind trying it out for me? If it didn't work it will set your HP to 1 when spawn protection is over :)February 2nd

Fixed spawn protection for TF2February 21st

Fixed player_spawn errorFebruary 24th

Fixed some other player_spawn errorFebruary 28th

Compatible with TF2, yaayJuly 26th

Recoded, now uses m_takedamage to block damage, so whatever game supports that ent prop this plugin will work on it
Reformatted config file, I don't think anyone is using this plugin, but if you update make sure to replace plugin.serverdefense.cfg with serverdefense.cfgAugust 16th

Updated spawn protect to use a more precise countdown, and a distance limitation so if you go outside of 'x' feet from spawn you lose your protection

Duo
01-01-2008, 00:47
You may want to do what I did with Whack-A-Pubby and if its TF2 have a default health value to restore people to. The damage amount is never sent in the player_hurt event in TF2.

arm5ky
01-01-2008, 06:37
This is the plugin I really need, over any other plugin, but cant get it to work.

Mod is Insurgency 217.163.31.17:27015 INS-T [2.0e] The.O.C Insurgency

1st Above you say "Contains a simple cvar to disable or enable this in-game (sp_enabled)." But In plugin.spawnprotection.cfg it is sp_disabled "0".

2nd Trying to use it to stop enemy sitting in spawn killing as you spawn, which is quite annoying in Insurgency :grrr:, but nothing happens with sp_disabled 1, or sp_disabled 0.

// Default: "0"
sp_scope "1"

// [Spawn Protection] Slay the spawn attacker
// -
// Default: "0"
sp_slay "0"


There are issues in Insurgency with slaying (Cant do it as no commit suicide, i believe, from using ATAC) but could you move the spawn attacker to spectator?


Hope you can help me get this working on server and the addition on move to spec would be a great bonus

Arm ##

ottobohn
01-01-2008, 11:09
I dunno if u're up for it, but could you also do anti-spawn camping? like spawn slaying after a period of time? Say it hits 1:30 minutes into the game, then it slays all who are in a certain grid you select. Then again at 2 minutes in. Etc. This would really enhanced the CSS world.

Otto

Neo_Bahamut_19
01-01-2008, 15:33
Is this integrated into the menu? If so I shall use it.

Greyscale
01-01-2008, 15:38
You may want to do what I did with Whack-A-Pubby and if its TF2 have a default health value to restore people to. The damage amount is never sent in the player_hurt event in TF2.

Then I won't support TF2, if that's how valve wants it then I won't bother trying to fix what they don't want us to use.

arm5ky, hm, does player_hurt work correctly in Insurgency? To stop the spawn killing I simply restore the player's health back to full as soon as the damage is dealt.

Tomorrow I will send you a test plugin to test the event variables and such in insurgency, that should tell me what I need to fix in this plugin.

ottobohn, Spawn camping would be surprisingly easy to implement. So when/if this plugin gets approved I will most likely add that.

Greyscale
01-01-2008, 15:38
Is this integrated into the menu? If so I shall use it.

Integrated into which menu?

Neo_Bahamut_19
01-01-2008, 16:39
the admin menu

ferret
01-02-2008, 07:49
Maybe you need to explain how spawn protection could even be added to the menu....

Neo_Bahamut_19
01-02-2008, 10:32
Basically a on/off switch, because some maps are so small that if you have that spawn protection, it makes one team overpower the other team, it could also have a way so that you could do something like Server Management>Spawn Protection>1 Second/5 Seconds/ 10 Seconds/ ect. as well as a way to do possibly a per map config as well to further help people with this, it could end up being a very useful tool for servers like mine where we play only custom maps where spawn camping can be a huge hassle...

Thats just a few thoughts ;)

ottobohn
01-02-2008, 11:07
I'll write you that script for the admin menu once the anti-spawn camping is implemented. I'm sure the writer for the plugin will allow you to have different variables.

Anti-spawn camping will bring sourcemod to the forefront. It will rival MANI and I can promote it much easier.

otto

Greyscale
01-02-2008, 13:57
I'll write you that script for the admin menu once the anti-spawn camping is implemented. I'm sure the writer for the plugin will allow you to have different variables.

Anti-spawn camping will bring sourcemod to the forefront. It will rival MANI and I can promote it much easier.

These next 2 features will be in the next release, dont worry about writing anything for me :)

Greyscale
01-02-2008, 17:23
Heh, now I'm struggling to think of a name that suits the plugin.

Its more than just spawn protection, its also an anti-camp and afk detection plugin.

steambob
01-02-2008, 18:21
It would be nice if the player under protection would change his color so one would see who is protected.

Another thing which would be nice is a countdown for the protected player (e.g. in the chat area) so he knows that the protection is temporary.

Greyscale
01-02-2008, 19:21
Ok, I have afk detection, anti-camp, and steambob's suggestions.

Now I need a name, and to append some settings to SM's menu.

Neo_Bahamut_19
01-02-2008, 20:17
I'll write you that script for the admin menu once the anti-spawn camping is implemented. I'm sure the writer for the plugin will allow you to have different variables.

Anti-spawn camping will bring sourcemod to the forefront. It will rival MANI and I can promote it much easier.

otto

what exactly do you mean by different variables?

Greyscale
01-04-2008, 15:36
Update


Added anti-camp
Added color to protected players
Added afk detection
Notification of protection and mortality to spawning players

steambob
01-04-2008, 19:51
Sorry to bother you with my suggestions, but would it be possible to stop the spawn protection not only on timer but also on player action?

- if the player starts moving (but looking around with mouse should not stop the spawn protection);
- if the player starts using weapons - primary/secondary attack or player changes from one weapon to another.

Thanks.

Greyscale
01-04-2008, 21:16
I'm not going to stop the protection if they move, that eliminates the purpose. Then it will only protect people who are afk.

If the player shoots someone I suppose I can end the protection, but only if they actually shoot another player, not just shooting a wall.

steambob
01-05-2008, 10:04
It is a pity you are not going to implement that.
In HL2DM the timer option is not enough for spawn protection. One can gravgun a person in a couple of seconds or pickup a colt and make a headshot (or get close enough to prepare for one-touch kill). And once the script detects that the player shoots not the wall but another person, the other person is already dead.

I hoped your plugin could replace the standalone plugin (http://www.esteticas.se/catman.php?lang=en) from Mästerkatten which incorporates the features I've described. This plugin is well tested and well-accepted in HL2DM community (but it takes many months before the author has time to implement other small features, like wearing off the protection on timer :)). Any chance you could change your concept so the options are available to stop the spawn protection on move and on weapon usage?

Thanks.

Greyscale
01-05-2008, 16:53
Hows about I reverse all damage done by a protected player? And as soon as he fires his spawn protection will go away. (Wasn't thinking about HL2DM when I posted before)

steambob
01-05-2008, 20:37
I might be wrong, but I think that once the damage is lethal, one cannot reverse it (the attacked player will die anyway). There are many ways in HL2DM to make a frag by a single shot.

ferret
01-05-2008, 21:49
The old fashion method to fix that is to give the player +1000 health. Nothing in-game can deal 1000 damage. Then when spawn protection ends, adjust everyone back to 100.

Neo_Bahamut_19
01-06-2008, 00:23
that would not work in TF2 because of the spy backstab...

ottobohn
01-06-2008, 06:08
I'll beta test this and help you tweak it for the best results. Thanks for helping us with this common issue!

Quickly, can you have it where it kicks people for name changing in game? We'd need it to stop people from the name change scripts when they hack. They're more difficult to ban when they auto name change.

otto

Greyscale
01-06-2008, 14:50
Steambob, I know that in source nothing can kill you when you just simply set their health back to 100. It's like SM sets it back before the damage actually happens.

There is another way of stopping damage, through the hacks plugin, it's a better way (stops bullet impact compeltely) I can transfer to that if spy backstab can get passed my current method

As for name changing, this isn't an anti-hack, sorry. If someone is changing their name rapidly then ban them, or find a good anti-hack plugin.

It's not really that fun to code either.. it would mean a loop that checks everyone's names and store it then check it again in like 2 seconds against the stored one and keep a counter of changes

EDIT: Hacks plugin won't work for TF2 :/, the current method should suffice though. I don't think this plugin works for TF2 anyway (the spawn protection part won't)

EDIT2: Current method works perfect. In CSS I awped a teammate in the head and they died in 1 hit. Then I enabled spawn protection and awped them in the head and they still had 100% HP, so it reverses the damage before the game can realize what happened.

Greyscale
01-06-2008, 16:53
Update

Made minor changes in the base plugin, just a new variable prefix, "sd_"

Included new admin integration plugin, it is an optional plugin that you install next to the base plugin to integrate these options with the SM admin menu.

Neo_Bahamut_19
01-06-2008, 21:17
I shall give this plugin a whirl tonight to see how well it works out, so look foreward to an edit on this post to tell ya how it goes, also, will this also have a per map setup config kinda like how the TF2 Class Limit has? If it doesn't yet, that would be a good idea as many maps run differently with their spawns, sometimes the last CP is right outside the spawn and it makes it harder to cap if you have a couple of invincibles coming out of the spawn.

Greyscale
01-06-2008, 21:40
They are only invincible for about 10 seconds, protection will wear off by the time they are running out of spawn to the cap.

You can make your own per-map config you know. Make a folder named cfg and put it in the maps folder then put in cfg files named after the map you want the config to be for and set the spawn protection length cvar in that config.

maps/config/ctf_2fort.cfg

sd_spawnprotect_time 3
// You can put any time you wantIf it changes to a map you don't have a config for, then it will use the value in plugin.serverdefense.cfg

Neo_Bahamut_19
01-06-2008, 22:41
I have noticed on problem, the protection doesnt seem to last the full 6 seconds I have it set for, as well as sometimes people dont loose their "greeness" after the 6 seconds and keep it until they die... Another problem is that (and I dont know if mabe it didnt do it to me because I am an admin and on the list) but it would not slap me for 100 damage after 2 minutes and would not kick me if I stayed afk for an entire round, I have the movement required set to 1, and I dont know if this includes being bumped into by other players and all as in TF2 other players can move you by bumping into you... Another thing that would be useful is if it were team colors as well.

Greyscale
01-06-2008, 23:09
It requires that you move a certain distance so it doesn't think you're afk. A little bump shouldn't be near enough to get it to think you aren't afk.

I'm thinking that these are all TF2 related bugs, because it works fine for me.

The anti-camp doesn't start slapping you at all if you sit in one spot for a while?

It might be GetClientAbsOrigin not working in TF2?

As for the spawn protection, did you configure it to turn them green, because by default they should be red.
The time should be right.. it plugs the value of the cvar directly into the timer.. weird

Neo_Bahamut_19
01-06-2008, 23:21
I set it to the green color as it would be bad to have a blue player with a red tint... and vice versa... If you have Team Fortress 2 you should stop on my server to see what its doing, mabe you would get a better understanding... Also, I have been killed before within the 6 seconds that I have it set to protect me for...

Greyscale
01-07-2008, 00:12
Yeah, as I said before I didn't think it would properly spawn protect in TF2 because player_hurt doesn't return the damage done.

I might go through and "TF2-ize" the plugin to work better, yeah I have TF2, send me the IP

Neo_Bahamut_19
01-07-2008, 00:34
The IP is in my signature, it is normally full throughout the day and late into the night. I'll leave the plugin on and if you need anything such as logs or such, just let me know.

ferret
01-07-2008, 08:21
Greyscale:
http://forums.alliedmods.net/showthread.php?t=65078

This plugin is designed to mimic the damage in player_hurt, you may find it useful in adapting for TF2.

steambob
01-07-2008, 18:39
I've just tested the plugin - the spawn protection part does not work on HL2DM.
The reason is the same - no damage info in player_hurt.

But setting health to a large constant on player_hurt works well (I think 100 would work also, I've only tested it with 500 :)).

Neo_Bahamut_19
01-07-2008, 19:20
For now I am unloading this plugin, let me know when you think you have the bugs worked out and I'll throw it back on and give it a test run on my TF2 server

Greyscale
01-07-2008, 19:51
*sigh* fine, I'll just set their health to 1000 in consideration of multi-mod support, not that big of a deal, just seems more clean to stop damage completely.

How will I know what HP to set it back to in TF2? (Different classes have different HPs)

steambob: Does anti-camp/afk work for you? I want to confirm this problem is only in TF2

steambob
01-07-2008, 19:55
Yes, anti-camp seems to work fine.
I have not tested afk though.

Greyscale
01-07-2008, 20:16
Ok, that's all I need to know, if anti-camp is working then afk should be (uses the same functions)

It's weird that neither are working for tf2, I'll check it out.

steambob
01-07-2008, 20:27
Is there any chance a "chat protection" can be done:
- if a player faces a wall for a certain time, he will get a protection ?
And then he would loose the protection on the move/weapon use?

Would be really nice.
Sorry for my suggestions :)

Thanks.

Greyscale
01-07-2008, 21:47
That would be easy abuse, it would have to know you are typing before it starts anti camping you, which is too quick, so you could just aim at a wall and camp then shoot then people come and be invincible heh.

Neo_Bahamut_19
01-07-2008, 23:47
what would be nice is if after typing it gave you a couple seconds of no input restriction to avoid that, as well as it taking like 3 seconds for it to turn on, so that you cant just start typing and be invincible and after you stop typing your still frozen and invincible for a couple of seconds giving you time to follow up and say something else

Greyscale
01-07-2008, 23:51
I can't detect when the user is writing a message, so just waiting 3 seconds of them not moving their crosshairs is easily exploitable by sitting down and camping, then lighting someone up who runs around the corner while not moving your crosshairs to stay invincible.

It's something that will most likey never be accomplished in source (or any game really) because there will always be ways to exploit it. Just buy a mic if you don't want it happening to you :)

Neo_Bahamut_19
01-08-2008, 01:37
what if the servers alltalk is off and you need to message the other teams members about something? why cant we have a team talk and all talk button?

Valve = EPIC FAIL w/NO COMMON SENSE

MoggieX
01-08-2008, 08:19
not sure if this has been suggested, however for:


If you are idle from when you spawn until the round ends the plugin will automatically either kick you, or throw you into spectators.


Can this look to see if the player is an admin or not, if it is an Admin (generic flag B) then to boot to spec and if not kick from server?

Matt

jones ray
01-08-2008, 09:18
I can't detect when the user is writing a message, so just waiting 3 seconds of them not moving their crosshairs is easily exploitable by sitting down and camping, then lighting someone up who runs around the corner while not moving your crosshairs to stay invincible.

It's something that will most likey never be accomplished in source (or any game really) because there will always be ways to exploit it. Just buy a mic if you don't want it happening to you :)

Could you detect if a player was facing a wall for 2-3 seconds then disable the camping timer? Also switch on protection until they turn away from the wall?

:)

Greyscale
01-08-2008, 17:44
Could you detect if a player was facing a wall for 2-3 seconds then disable the camping timer? Also switch on protection until they turn away from the wall?

:)

But what if a camper just sat there (aiming at a wall), he would get invincibility and not get punished for camping

Can this look to see if the player is an admin or not, if it is an Admin (generic flag B) then to boot to spec and if not kick from server?

No problem, I'll add a third mode for that cvar :)

what if the servers alltalk is off and you need to message the other teams members about something? why cant we have a team talk and all talk button?

Valve = EPIC FAIL w/NO COMMON SENSE

I'm sure it's because they didn't want to complicate things more with two mic commands. (Most people can't even open console). Don't think it's possible to make a command to do this with SM either.

arm5ky
01-08-2008, 20:28
Greyscale,

As per my previous post, its not working on our Insurgency Server.

I have included the error log, think i was able to turn on debug for the plugin.

Hope you can help.

Arm5ky

Greyscale
01-08-2008, 20:58
Ok I fixed all those invalid handle errors, but that's the only error I saw from my plugin.

My next update should fix it, I am just going to set their HP to 1000 so it works with all mods.

Greyscale
01-08-2008, 21:25
Update


Fixed attempt to end spawn protection on players that leave in the middle of it
Fixed invalid timer errors on map start with re-connecting players
Added mode '2' to sd_afk_punishment that kicks reg players but spectates admins
Spawn protection should now work in all mods

jones ray
01-08-2008, 22:20
But what if a camper just sat there (aiming at a wall), he would get invincibility and not get punished for camping


Yes this is true, but you would have to be a certain distance to the walls for it to work, such as the following plugin.

Website = http://www.esteticas.se/catman.php?lang=en

File link = http://www.esteticas.se/catman/sc_protect_3.2.9.zip

When you look away from the wall = no protection, and you have to have your nose up against it for a 2-3 second time for it to enable.... any campers wanting to look at walls and not kill anyone it would be ideal, but any campers looking into the play area would just get slapped as normal

:P

Neo_Bahamut_19
01-08-2008, 22:25
Update

Fixed attempt to end spawn protection on players that leave in the middle of it
Fixed invalid timer errors on map start with re-connecting players
Added mode '2' to sd_afk_punishment that kicks reg players but spectates admins
Spawn protection should now work in all mods

Did you fix the whole thing of players still having "glow" after the protection wears off?

Greyscale
01-08-2008, 22:34
Did you fix the whole thing of players still having "glow" after the protection wears off?

I couldn't reproduce this, it is probably the SM stock I am using, BAILOPAN told me that he is re-making that stock sometime soon to work for TF2 I think he said. So as soon as you update to that version when it becomes available, the bug will fix itself.

Greyscale
01-08-2008, 22:36
Yes this is true, but you would have to be a certain distance to the walls for it to work, such as the following plugin.

Website = http://www.esteticas.se/catman.php?lang=en

File link = http://www.esteticas.se/catman/sc_protect_3.2.9.zip

When you look away from the wall = no protection, and you have to have your nose up against it for a 2-3 second time for it to enable.... any campers wanting to look at walls and not kill anyone it would be ideal, but any campers looking into the play area would just get slapped as normal

:P

Why not just use this plugin? Is it not available for the game you are running?

I see the idea now, and I see it might work, but while you are protected you are going to be killed anyway as soon as you move, because if someone from the other team see's you they will just camp you until you finish your message or move.

jones ray
01-08-2008, 22:47
Why not just use this plugin? Is it not available for the game you are running?

I see the idea now, and I see it might work, but while you are protected you are going to be killed anyway as soon as you move, because if someone from the other team see's you they will just camp you until you finish your message or move.

The plugin supports my game yes, but i am only running sourcemod plugins so thought it would be the place to ask for it :P

Also i would assume if i did use that plugin combined with your release, even though i was protected i would get slapped away from the wall and out of protection, but i have not tried this as i don't want to run other plugins anymore.

If someone else does see you and waits to kill you, well its not exactly in keeping with this idea of non camping plugin i agree, but at least you have the option to face a wall to chat if needed :)

:)

Neo_Bahamut_19
01-09-2008, 02:30
I am giving it a try tonight, gonna see if it starts any problems, ill let ya know and if needed I will tape it and put it on youtube for ya to see ;) hope it doesnt happen though

Edit: so far so good, spawn protection works like a charm, havnt tried backstabs, but I have a feeling that its not gonna block that for some reason (dont think thats a player_hurt event) but oh well, it does a pretty good job as is. Great job on it man, double thumbs up


EDIT! BIG ISSUE! After someone spawns a couple seconds passes and they are reduced to 100 health for no reason, I checked to make sure it was this plugin and it is... Only way to avoid it is to go to the cabinet after it does it... Had to take it off the server because of this. Seems as though it happens when your protection turns off...

arm5ky
01-09-2008, 16:16
Hope its okay to change the code for our own use. The spawn camping is working but the models where not changing back to normal colour, so i took that bit out of the sp file and recompiled. Is that okay?

Ann now works a treat.

Many many thanks..

remercy
01-09-2008, 19:49
ok so ive got a bit of a problem

it would seem that some of the players on my server are keeping spawn protection on, long after it should have disabled itself but th odd thing is that is only a few players

i am running both css rpg and dm

along with mani admin

Greyscale
01-09-2008, 22:11
Neo, this is TF2 right?

Why is their HP being set to 100 a huge issue? That's how spawn protection is taken away. Do you mean 100 as in a literal "100" or 100% HP (because I know TF2 has HP like 125, 200, 300, etc). It should be recording your HP when you spawn and when protection is over it should reset it back to the earlier recorded HP. Does GetClientHealth not work for TF2?

arm5ky, yeah, this is a known issue, it will eventually be fixed though, by BAILOPAN.

remercy, Not good, I'll take a look, I need more information though. Does it tell them spawn protection is over, ever? Do they change back to normal color, but keep their 5000 HP?

Neo_Bahamut_19
01-10-2008, 00:15
If you have 175 HP at spawn it reduces you to 100 HP after a little bit, and thats with all classes and healths, always sets to 100, weather your a scout with 125 starting or a heavy with 250 or w/e it is, it always knocks you down to 100 HP after the protection goes off...

remercy
01-10-2008, 10:26
the glitch only happens to one two people at a time and they often keep it between map changes.i don't believe that it tells them that spawn protection is over, they stay red, and still keep the hp. they are practically immortal

maybe you can swing by our site and contact me on the forums so you can see the issue first hand
www.teampainclan.com (http://www.teampainclan.com)

72.233.5.98:27017 = server ip

Remercy = my xfire

if you contact me from 10-12pm est, i can get you in there and we can turn it on for you so you can see exactly whats happening

Greyscale
01-10-2008, 19:51
Neo, it is probably a TF2 specific problem.. again. I'll check it out.

remercy, that info gave me what I need to know, it means that there is some sort of timer error happening over map changes. Probably something simple and should be fixed in the next release, thanks for the report.

Greyscale
01-12-2008, 16:59
Hm I can't figure out why the timer is never finishing. If there was an error when the timer is started, then they shouldn't become immortal, so the timer is starting fine, it's just either erroring sometime when it ends, or something more weird is happening inbetween

Greyscale
01-13-2008, 13:48
Update

Fixed never-ending spawn protection (thanks remercy)
Replaced depreciated functions, replaced old code with new SM stocks
Alpha now works in spawn protection (it didn't before), and I believe it should work right in TF2 now
Fixed never-ending loop of joining/kicking bots when afk protection was enabled

Neo_Bahamut_19
01-13-2008, 20:02
Did you figure out what I was talking about with the HP drops?

Greyscale
01-13-2008, 20:13
Yeah, but the only that tells me is that GetClientHealth is possibly broken for TF2. So what I need to do is make defines for all classes in TF2 (or they should be included in SM) and then match the class with the hp

Neo_Bahamut_19
01-14-2008, 01:56
So not quite ready for TF2 yet?

Greyscale
01-14-2008, 20:31
Not yet, but I'm not giving up :wink:

Neo_Bahamut_19
01-15-2008, 00:18
good to hear that man, now get cracking *snap* *snap* lol j/k, if you need soemones server to test it on just let me know, if you want to add me on steam neo_bahamut_19

LocutusH
01-15-2008, 08:23
I get a lot of these errors:

L 01/15/2008 - 14:13:48: SourceMod error session started
L 01/15/2008 - 14:13:48: Info (map "de_strata") (file "errors_20080115.log")
L 01/15/2008 - 14:13:48: [SM] Native "CloseHandle" reported: Handle af3018b is invalid (error 1)
L 01/15/2008 - 14:13:48: [SM] Debug mode is not enabled for "serverdefense/serverdefense.smx"
L 01/15/2008 - 14:13:48: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 46 on
CS:S, SM 1854 Linux, SD V1.4b

The plugin is kicking my players every round crazy, because of being AFK. But they are not.

Rebell
01-15-2008, 10:23
It dont work for me:


Loaded plugins:
---------------------
0: "Metamod:Source Interface v1.4.2.414"
---------------------


meta list
-Id- Name Version Author Status
[01] Mani Admin Plugin 1.2BetaR Mani RUN
[02] GoreMod 3.2.5 c0ldfyr3 RUN
[03] SteamBans Detox 1.1 sslice/opi RUN
[04] SourceMod 1.0.0.181 AlliedModders LLC RUN
[05] CS:S Tools 1.0.0.178 AlliedModders LLC RUN
[06] SDK Tools 1.0.0.177 AlliedModders LLC RUN
[07] Hacks Extension 1.3.0.0 Knagg0 RUN



[SM] Listing 13 plugins:
.
.
.
11 <Failed> "Server Defense" (1.4b) by Greyscale
.
.
.

LocutusH
01-15-2008, 10:42
It dont work for me:




You need the latest SM version (1854+). From what i see, you are using some 181x.

Greyscale
01-15-2008, 18:49
I get a lot of these errors:

L 01/15/2008 - 14:13:48: SourceMod error session started
L 01/15/2008 - 14:13:48: Info (map "de_strata") (file "errors_20080115.log")
L 01/15/2008 - 14:13:48: [SM] Native "CloseHandle" reported: Handle af3018b is invalid (error 1)
L 01/15/2008 - 14:13:48: [SM] Debug mode is not enabled for "serverdefense/serverdefense.smx"
L 01/15/2008 - 14:13:48: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 46 on CS:S, SM 1854 Linux, SD V1.4b

The plugin is kicking my players every round crazy, because of being AFK. But they are not.

I'll take a look, (I thought I fixed the false afk kicking bug :/)

Greyscale
01-18-2008, 19:43
Update


Removed AFK module, there are plenty of other plugins to use for that, this one was pretty half-assed too.
Removed AFK toggle from the SM menu (so don't forget to update that)
Tried to fix HP bug for TF2, Bahamut, do you mind trying it out for me? If it didn't work it will set your HP to 1 when spawn protection is over :)

Neo_Bahamut_19
01-23-2008, 00:46
Update

Removed AFK module, there are plenty of other plugins to use for that, this one was pretty half-assed too.
Removed AFK toggle from the SM menu (so don't forget to update that)
Tried to fix HP bug for TF2, Bahamut, do you mind trying it out for me? If it didn't work it will set your HP to 1 when spawn protection is over :)

I will try it out tomorrow sometime and let you know my results, I sure hope it works :mrgreen:

Edit: I havn't gotten to test it yet as I am in the middle of some other stuff, but be assured, I will be testing it soon!

Neo_Bahamut_19
01-26-2008, 17:57
25 "Fun Cvars" (1.0.0) by Wild1234
26 <Failed> "Server Defense" (1.5) by Greyscale
27 "Server Defense Menu" (1.5) by Greyscale


That is what I get, for some reason it does not load...

When I try to manually load it I get the following


] rcon sm plugins load serverdefense
[SM] Plugin serverdefense.smx failed to load: Unable to open file.


The log states the following:


L 01/26/2008 - 17:55:05: [SM] Unable to load plugin "serverdefense/serverdefense.smx": Native "FindSendPropInfo" was not found.

Greyscale
01-26-2008, 23:30
You need to update your SM build to 1854+

Neo_Bahamut_19
01-26-2008, 23:37
oh ok, thanks, thought that was the issue

Edit: I tried the plugin, after it started working, people still remained green, this time everyone was green, constantly, they wouldnt loose it till death. It also knocks us down to 1 health still after the protection is over... :\

Greyscale
01-27-2008, 22:25
Ok then that tells me the problem, the m_iHealth offset doesn't work in TF2 :/

I'll do some research and try to fix it

Neo_Bahamut_19
01-27-2008, 23:44
Ok, thanks man, this would be a great plugin for TF2 as there are lots of maps where spawn camping is a problem...

Greyscale
02-02-2008, 16:01
Update

Fixed spawn protection for TF2

Neo_Bahamut_19
02-02-2008, 18:19
Update

Fixed spawn protection for TF2

I shall try it tonight once the server is empty

KDF
02-06-2008, 10:34
Hi, i would like to know if your plugin work great on insurgency please?

Any problem?

KDF
02-06-2008, 13:04
Hi, i try it on insurgency. I can see the plugin is loaded with rcon sm plugin list.

When I spawn i see "you are protected for 10 sec" but its not work. I can be spawn killed and the plugin do nothing.

What I forgot to do please ?

Greyscale
02-06-2008, 20:25
Is your HP being changed at all? It should be getting set to 5000.

When you see it loaded in sm plugins list, you are sure there is no "<Failed>" preceding the line?

KDF
02-06-2008, 22:14
Where I can see how my hp are set? And i dont see any failed. I can see other people in my team in red when we spawn. But enemy can kill em without any problem.

Greyscale
02-06-2008, 22:33
There is no HP in Insurgency?

Nice.

I don't see any way to do it for Insurgency then.. hm.
Do you know if there is a player_hurt even in Insurgency?

KDF
02-06-2008, 22:44
We dont have an hp bar. but where you want to change the hp to 5000? in wich files please?

Neo_Bahamut_19
02-07-2008, 19:43
Do you think making a specific plugin whereas each class has a specific health (like scout registers at 125, pyro at 175, ect.) would work better? Mabe so it reads what class you are using and throws you back to that HP after protection is over.

Greyscale
02-07-2008, 22:38
I shall try it tonight once the server is empty

Did the new version not work?

Neo_Bahamut_19
02-07-2008, 22:41
no, it still did the same thing... I think what it needs to do is identify the Team Fortress 2 game, and identify which character you are using and apply the correct HP that way...

Greyscale
02-08-2008, 21:11
It set their HP to 1?

Or to 100?

That is my last resort, but I shouldn't be getting these problems with only TF2..

Neo_Bahamut_19
02-08-2008, 22:04
100, it resets their HP to 100

Greyscale
02-09-2008, 15:27
It's probably something to do with getting their HP as the spawn, because no one else has had this problem with TF2

Neo_Bahamut_19
02-09-2008, 22:48
What do you mean by that? How can I be the only one getting the error in TF2?

Greyscale
02-10-2008, 01:34
I mean in general, no other plugin authors have been having trouble getting HP in TF2

Neo_Bahamut_19
02-10-2008, 03:13
Hmm, mabe its your technique, mabe ask some others that might have dealt with it before

Greyscale
02-10-2008, 22:51
Just found that the same thing is happenin to someone else, so it's not me, its TF2, or some game incompatibility in GetClientHealth

Neo_Bahamut_19
02-12-2008, 17:47
Might not be there as each character has a different health setup and takes damage differently sometimes (demomen take less damage from explosives than any other class and pyros cannot be set on fire as well as other differences between classes)

Greyscale
02-13-2008, 20:43
It's possible, but you wouldn't think that should mess up their health on spawn, the next frame everything is good.

J@y-R
02-21-2008, 11:01
Hello

I have this found in my Sourcemod Error logs

[SM] Native "CloseHandle" reported: Handle 36c2011a is invalid (error 1)
L 02/21/2008 - 15:55:21: [SM] Displaying call stack trace for plugin "serverdefense/serverdefense.smx":
L 02/21/2008 - 15:55:21: [SM] [0] Line 147, serverdefense.sp::PlayerSpawn()
L 02/21/2008 - 15:56:15: [SM] Native "CloseHandle" reported: Handle 37b10128 is invalid (error 3)
L 02/21/2008 - 15:56:15: [SM] Displaying call stack trace for plugin "serverdefense/serverdefense.smx":
L 02/21/2008 - 15:56:15: [SM] [0] Line 147, serverdefense.sp::PlayerSpawn()

Is a f...... bug in CSS !!! Any people is sometimes a Hulk/GOD

Can you fix that pls :up:

WFG ^^
JaY

Greyscale
02-21-2008, 21:49
Woot for bugs :x

Update


Fixed player_spawn errorThanks for the report

J@y-R
02-23-2008, 22:23
Hey

With the new version from Sourcemod 1.0.0.1904 is come a new bug in your plugin :(

L 02/24/2008 - 03:46:40: [SM] Displaying call stack trace for plugin "serverdefense/serverdefense.smx":
L 02/24/2008 - 03:46:40: [SM] [0] Line 123, serverdefense.sp::PlayerSpawn()
L 02/24/2008 - 03:47:44: [SM] Native "CloseHandle" reported: Handle 1ab0127 is invalid (error 3)

Can you fix this pls !!

Thx
JaY

Greyscale
02-24-2008, 19:15
Update


Fixed some other player_spawn error
I made a very tiny change, but I put it on my server and through 12 bots in and changed the map and waited and got no errors, so hopefully this did it.

J@y-R
02-24-2008, 20:35
Ohh Thanks for fix

Thx

Mfg
JaY

W][LDF][RE
02-24-2008, 21:34
Awesome...been looking for something like this for my 2fort server.

Greyscale
02-28-2008, 12:45
Update


Compatible with TF2, yaay

Rebell
03-01-2008, 07:48
Works fine now !

cya :)

Zalaxy
03-01-2008, 12:42
Just got one complaint to register. On sudden death melee mod. The spawn protection stays on. Since there is no way around it that I know off. I've been forced to take this mod off of my server. Hopefully it's nothing bad. But thought I would share.

ottobohn
03-05-2008, 17:41
Is it possible to turn the anti-camping feature depending on how close they are to a spawn point? I'd like to have it so when they're anywhere within 20 ft to a spawn point, it'll beacon them after 1:30 seconds.

Otto

J@y-R
03-17-2008, 11:25
Hey

Withe new Version of Sourcemod 1.0 (1946)
come a bug in your plugin, can you please fix that

L 03/17/2008 - 05:00:40: [SM] Displaying call stack trace for plugin "serverdefense/serverdefense.smx":
L 03/17/2008 - 05:00:40: [SM] [0] Line 118, serverdefense.sp::PlayerSpawn()
L 03/17/2008 - 05:01:26: [SM] Plugin encountered error 4: Invalid parameter or parameter type
Greetz
JaY

ColdFire
03-17-2008, 12:06
Hey

Withe new Version of Sourcemod 1.0 (1946)
come a bug in your plugin, can you please fix that

L 03/17/2008 - 15:24:23: [SM] Displaying call stack trace for plugin "sm_parachute.smx":
L 03/17/2008 - 15:24:23: [SM] [0] Line 343, /home/groups/sourcemod/upload_tmp/phpL9Yhxs.sp::TeleportParachute()
L 03/17/2008 - 15:24:23: [SM] [1] Line 388, /home/groups/sourcemod/upload_tmp/phpL9Yhxs.sp::OnGameFrame()
L 03/17/2008 - 15:24:23: [SM] Native "TeleportEntity" reported: Entity 718 is not valid or is freed
L 03/17/2008 - 15:24:23: [SM] Displaying call stack trace for plugin "sm_parachute.smx":
L 03/17/2008 - 15:24:23: [SM] [0] Line 343, /home/groups/sourcemod/upload_tmp/phpL9Yhxs.sp::TeleportParachute()
L 03/17/2008 - 15:24:23: [SM] [1] Line 388, /home/groups/sourcemod/upload_tmp/phpL9Yhxs.sp::OnGameFrame()
L 03/17/2008 - 15:24:23: [SM] Native "TeleportEntity" reported: Entity 718 is not valid or is freedGreetz
JaY

Are you sure you're in the right thread? I can read "sm_parachute" in your logs :)

J@y-R
03-17-2008, 13:10
Ups you have right ^^
i edit this ^^

steambob
03-17-2008, 19:33
05:00:40: [SM] Displaying call stack trace for plugin "serverdefense/serverdefense.smx":
L 03/17/2008 - 05:00:40: [SM] [0] Line 118, serverdefense.sp::PlayerSpawn()
L 03/17/2008 - 05:01:26: [SM] Plugin encountered error 4: Invalid parameter or parameter type
J@y-R: the error message looks to be incomplete, and is poiniting out to a missing translation file (or at least a missing entry in the file).

are you sure you have put serverdefense.phrases.txt in sourcemod/translations/ directory?

J@y-R
03-17-2008, 20:02
Yes I have !!
But the error message come no longer

But I have the sp-file with the new version of sourcemod compiled and now is the adminmenu function down !!!
And the Spawnprotection have a bug!!
It remains for some players forever and And then is HULK

Greyscale
03-22-2008, 19:04
Delete the plugin from your server and re-install it.

Looks like something was screwed up, so you might as well start fresh.

J@y-R
07-18-2008, 12:13
L 07/18/2008 - 15:36:14: [SM] Native "FindDataMapOffs" reported: Entity 1 is invalid
L 07/18/2008 - 15:36:14: [SM] Displaying call stack trace for plugin "serverdefense/serverdefense.smx":
L 07/18/2008 - 15:36:14: [SM] [0] Line 303, serverdefense.sp::UTIL_GetClientHealth()
L 07/18/2008 - 15:36:14: [SM] [1] Line 158, serverdefense.sp::PostPlayerSpawn()

Greyscale
07-18-2008, 14:12
Fixed.
I'll release soon

Greyscale
07-26-2008, 21:14
Update

Recoded, now uses m_takedamage to block damage, so whatever game supports that ent prop this plugin will work on it
Reformatted config file, I don't think anyone is using this plugin, but if you update make sure to replace plugin.serverdefense.cfg with serverdefense.cfg

82694
08-13-2008, 19:08
I'm running this on a HL2 TDM server and would like to say it works great.
The only issue I have is I had to set the protection time to about 3 sec to keep people from running around invincible for 10 sec.

Would it be to much of a bitch to add movement into the equation. So as soon as they move the protection is gone or the time which ever occurs first.

Greyscale
08-13-2008, 20:56
That's a good idea, and possible. I can use the player_footstep event although if the players were smart they could use +speed to bypass that event. Time will still remove it though.

82694
08-14-2008, 01:45
Sweet :)

Greyscale
08-17-2008, 00:17
Update

Updated spawn protect to use a more precise countdown, and a distance limitation so if you go outside of 'x' feet from spawn you lose your protection

82694
08-17-2008, 14:04
Sweet thanks.

ljprevo
08-22-2008, 12:10
How do you turn the timer off and just use feet, and how do you turn the colors off completely?

Greyscale
08-22-2008, 12:30
Set these to:

// Amount of time to protect player after spawning
sd_spawnprotect_time "0"

// Alpha component of protected player
sd_spawnprotect_alpha "255"

// Blue component of protected player
sd_spawnprotect_blue "255"

// Green component of protected player
sd_spawnprotect_green "255"

// Red component of protected player
sd_spawnprotect_red "255"

Although I don't suggest going soley off feet, because people will learn they can just sit there and stay god moded as long as they don't move outside the radius.

boykevin
11-10-2008, 19:45
Having a bit of a problem
heres my settings
//
// Enable or disable spawn protection
sd_spawnprotect "1"

// Amount of time to protect player after spawning
sd_spawnprotect_distance "0"

// Amount of time to protect player after spawning
sd_spawnprotect_time "5.0"

// Alpha component of protected player
sd_spawnprotect_alpha "175"

// Blue component of protected player
sd_spawnprotect_blue "0"

// Green component of protected player
sd_spawnprotect_green "0"

// Red component of protected player
sd_spawnprotect_red "255"

// Enable or disable the anti-camp feature
sd_anticamp "1"

// How frequently, in seconds, the plugin interprets each player as idle or not
sd_anticamp_frequency "1"

// How many times, consecutively, the player needs to be interpretted as idle to start camping punishment
sd_anticamp_offense "10"

// How frequently, in seconds, to punish camping players until they stop camping
sd_anticamp_punish_frequency "3"

// A scale of how far the player needs to travel to be considered not idle
sd_anticamp_radius "80"

// How much damage to slap camping players with
sd_anticamp_slapdmg "0"


Some how the spawn protect lasts longer then a minute any help o and the game is TF2

Kahless
02-17-2009, 15:58
What is the override command to deny it to some levels for example to deny teamswitch the command is

":teamswitch" "deny"

radtaz
06-16-2009, 03:19
I run a HL2DM server and this plugin is great one problem is it only works in team mode is there a way to make it work in both team mode and regular DM mode?

TcOxD
06-16-2009, 15:11
Is it possible to allow engeneer and sniper(tf2) to stay in base without slaping! because these 2 clases are more in base as outside by 2fort:)

thx maybe u can help me

best regards tco

DarthNinja
01-21-2010, 15:48
I'd like to see the ability to toggle off protection if the protected player shoots.

Elite_Fallen_Angel
07-10-2010, 18:37
I have this on my TF2 server and for some odd reason it makes the Heavy class immune to any damage at all times, essentially like God-Mode. The plugin works for everything else just fine though.

Here is a copy of my serverdefense.cfg

// Server Defense
//
//

//
// Spawn Protect
//

// Enable or disable spawn protection
sd_spawnprotect "0"

// Amount of distance to protect player after spawning
sd_spawnprotect_distance "15"

// Amount of time to protect player after spawning
sd_spawnprotect_time "4.0"

// Alpha component of protected player
sd_spawnprotect_alpha "255"

// Blue component of protected player
sd_spawnprotect_blue "0"

// Green component of protected player
sd_spawnprotect_green "0"

// Red component of protected player
sd_spawnprotect_red "255"

//
// Anti-Camp
//

// Enable or disable the anti-camp feature
sd_anticamp "0"

// How frequently, in seconds, the plugin interprets each player as idle or not
sd_anticamp_frequency "1"

// How many times, consecutively, the player needs to be interpretted as idle to start camping punishment
sd_anticamp_offense "10"

// How frequently, in seconds, to punish camping players until they stop camping
sd_anticamp_punish_frequency "3"

// A scale of how far the player needs to travel to be considered not idle
sd_anticamp_radius "80"

// How much damage to slap camping players with
sd_anticamp_slapdmg "5"

I don't know if it may be an update that's conflicting or what but this server is new with pretty much all stock configurations. Mani-Mod is also installed but there isn't anything that I'd imagine would conflict with the plugin, especially considering it's just the Heavy Class that's effected. I also should note that the Heavy class with glow a faint red so I'm guessing the spawn protection is not taking effect on them for some reason.

DarthNinja
11-04-2010, 20:55
I just wanted to report that if you change sd_spawnprotect from 1 to 0 on the fly, player's keep any spawn protection they have until they reconnect.
Kinda a major bug as one entire team plowed the other because they had godmode for the whole round.

Just wanted to report that.

Rd1981
04-24-2011, 17:18
It does work for tf2 with the new version you have to tell it how many seconds and feet you want it to stop. Which ever you reach first the amount of secs or the feet it will turn off.

Poi5on
03-06-2012, 16:36
Is it possible to disable the distance and just use the time?

Grot
03-17-2013, 15:15
im trying to make it so if blue are in the red non pvp area the reds can kill blue but not visa versa

MaloModo
04-17-2016, 13:33
No post since 03-17-13. Anyone still using this successfully?

jmcpit
05-29-2017, 08:41
Hi

in Half Life 2 Team Deathmatch mode works the plugin great. When run the Server in Deathmatch mode works the plugin not. Can you please fix that?

lambofgod
06-04-2017, 02:19
Anybody still using this? I can't seem to get it to work properly or for the Admin menu items to list in a readable fashion. Would really be nice to have anti spawn camp.