Raised This Month: $32 Target: $400
 8% 

[PLUGIN] SpawnProtect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-13-2007 , 00:40   SpawnProtect
Reply With Quote #1

This was originally just a workaround to avoid a crash with mani's spawn protection alongside my KnifeMug plugin, but I'm releasing it anyway.

If a player attacks a team mate in any time from the freeze time end (start of the round) until the sm_protecttime is up, the attacker will be slain and the victim will have his health restored.
REQUIREMENTS:
CVARS:
  • sm_protecttime
    • Sets the time before players can team attack without getting slain
    • Default Values: Anywhere from 1 to 30
If you wish to turn off the plugin (but keep it loaded), set sm_protecttime to 0

CHANGELOG:
  • 1.0.2
    • Added effects and sounds to the slay - now REQUIRES PimpinJuices TempEnts extension
    • Fixed some errors that occurred when handling bots
    • Fixed an error involving the server trying to handle itself as a player
    • Added console output for slaying
  • 1.0.1
    • Updated to utilize GetUserOfId instead of FindEntityOfUserId function
    • Fixed plugin not "turning back on" after being off
  • 1.0.0
    • Release

Thank you to everyone who helped out on this . I could list, but you know who you are.

And of course thanks to BAILOPAN, DamagedSoul, and the rest of the SourceMod dev team for working out a few snags I hit.

More thanks: PimpinJuice for his tempents extension, Olly (testing/pointing out bugs), sslice, DaveB, LDuke (telling me what needed to be precached for effects), and the magical pixie goblins.

Thank you to GameConnect for allowing me to test this on their servers.
Attached Files
File Type: sp Get Plugin or Get Source (spawnprotect.sp - 580 views - 9.5 KB)

Last edited by FlyingMongoose; 04-29-2007 at 16:50.
FlyingMongoose is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-13-2007 , 19:53   Re: [PLUGIN] SpawnProtect
Reply With Quote #2

Update, check changelog.
FlyingMongoose is offline
cybermind
Senior Member
Join Date: Oct 2004
Old 04-14-2007 , 00:53   Re: [PLUGIN] SpawnProtect
Reply With Quote #3

This doesn't look like it will re-enable itself once the cvar goes back to within the range of 1-30 (after having been previously disabled by going outside of this range), is this intended?
cybermind is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-14-2007 , 01:05   Re: [PLUGIN] SpawnProtect
Reply With Quote #4

let me double check that and test, cuz if that's the case, then it's wrong >.< and no it's not intended.

Edit: you were correct, I am in the process of fixing now, thank you for pointing out this flaw. Granted this bug is not as urgent as a crash bug, but I can see this as causing potential issues for some servers who like to change their cvars while running often...

Last edited by FlyingMongoose; 04-14-2007 at 04:09.
FlyingMongoose is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-14-2007 , 04:33   Re: [PLUGIN] SpawnProtect
Reply With Quote #5

Bug reported by cybermind has been fixed, version number not changed (too minor a change, I have some other features planned for the future though ;) )
FlyingMongoose is offline
API
Veteran Member
Join Date: May 2006
Old 04-14-2007 , 09:13   Re: [PLUGIN] SpawnProtect
Reply With Quote #6

I see a possible admin plugin in the future...
Great job, keep it up

EDIT: Also, as for the suicide thing, you could scan for CBaseEntity::EventKilled, but I would need to add support for CTakeDamageInfo.

Last edited by API; 04-14-2007 at 09:18.
API is offline
Send a message via AIM to API
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-14-2007 , 14:12   Re: [PLUGIN] SpawnProtect
Reply With Quote #7

nah, this won't be an admin plugin...it will most likely shift into a ta/tk plugin ;) but not yet, I'm working on another plugin, and while I've hit a snag in file reading, once i get that exact portion done, well, the rest of the plugin is complete, so as soon as I can actually get the file reading to work, that other plugin I'm working on is done (apart from testing)
FlyingMongoose is offline
SaintK
Veteran Member
Join Date: Mar 2004
Old 04-18-2007 , 17:25   Re: [PLUGIN] SpawnProtect
Reply With Quote #8

Hi,

I have this weird thing going on with this plugin. First when i installed it, and i just changed map to activate it, it wouldnt run correctly. Whenever you would attack a team mate within the limit set, the server would kick you with some sort of message that you were banned for too many TK's (1/3). Infact you didnt really get banned, because you could directly rejoin. Then i restarted the server, now the plugin was running good when we tested it. Now after it run some hours, the same started to happen again like i experianced when it was first set up. I left the server for what it was cause i was doin some other things at that time, and when i joined in later, the plugin seems to have stopped working completely, now you can just TK people and only the servers default tk protection will work, and thats getting slayed next round for TK.

Code:
23:32:23 Metamod:Source version 1.4.0.372
         Compiled on: Apr  7 2007
         Plugin interface version: 10:7
         SourceHook version: 4:3
         http://www.sourcemm.net/
Code:
23:32:39  SourceMod Version Information:
             SourceMod Version: 1.0.0.705
             JIT Version: JIT (x86), 1.0.0.659
             JIT Settings: Generic 80486
             http://www.sourcemod.net/
Code:
23:33:01 [SM] Listing 3 plugins:
           01 "SpawnProtect" (1.0.1) by FlyingMongoose
           02 "WeaponRewards" (1.0.0) by FlyingMongoose
           03 "Admin Auth" (1.0.0.0) by AlliedModders LLC
Running on Debian Sarge
SaintK is offline
FlyingMongoose
Veteran Member
Join Date: Mar 2004
Old 04-18-2007 , 18:14   Re: [PLUGIN] SpawnProtect
Reply With Quote #9

spawn protection of other plugins can cause problems with this one, make sure you turn them off. if you use mani it's mani_tk_spawn_protection (I think), it needs to be 0.
FlyingMongoose is offline
SaintK
Veteran Member
Join Date: Mar 2004
Old 04-19-2007 , 07:45   Re: [PLUGIN] SpawnProtect
Reply With Quote #10

Hi,

I dont run anything other then Sourcemod.

The only thing i forgot to do was setting mp_tkpunish 0, but i cannot imagen that setting would cause all this behavior. I've set it to 0 now and will test later today when i am home if anything improved.
SaintK 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 17:13.


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