Raised This Month: $51 Target: $400
 12% 

[TF2] Killing during setup.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
casvdry
Member
Join Date: Mar 2008
Old 03-14-2011 , 14:41   [TF2] Killing during setup.
Reply With Quote #1

Is there a way other than a plugin to prevent others from killing or injuring through gates? Like a way to disable damage dealt during setup time? Kind of like applying bonus round immunity to both teams during setup (Without disabling explosive forces such as rocket jumping, etc)

Thank you.
casvdry is offline
Invader Amoto
Member
Join Date: May 2009
Old 03-14-2011 , 15:29   Re: [TF2] Killing during setup.
Reply With Quote #2

You can try hooking "player_hurt" and if the attacker isn't the userid getting hurt, then return Plugin_Stop.
Invader Amoto is offline
Kevin_b_er
SourceMod Donor
Join Date: Feb 2009
Old 03-14-2011 , 23:01   Re: [TF2] Killing during setup.
Reply With Quote #3

That will NOT work.

Blocking the player_hurt event does not change the damage actually dealt. The event is sent out as a notification after the damage is already calculated and worked.
__________________
Kevin_b_er is offline
casvdry
Member
Join Date: Mar 2008
Old 03-16-2011 , 04:01   Re: [TF2] Killing during setup.
Reply With Quote #4

How could this be done?
casvdry is offline
Pawn 3-pg
Senior Member
Join Date: Jul 2009
Old 03-16-2011 , 11:16   Re: [TF2] Killing during setup.
Reply With Quote #5

You would need to use SDKHooks to hook OnTakeDamage, then just return Plugin_Handled if the attack happened before the round started.
Pawn 3-pg is offline
casvdry
Member
Join Date: Mar 2008
Old 03-16-2011 , 13:57   Re: [TF2] Killing during setup.
Reply With Quote #6

As with my other request I'll gladly pay $15 (Hope that's fair) if someone can code that for me.
casvdry is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-16-2011 , 17:24   Re: [TF2] Killing during setup.
Reply With Quote #7

Do all maps on your server have a setup time? I could do this one easily, but it might cause problems on maps without setup.

[edit]

Assuming all maps have a Setup time, the attached plugin should do the trick (requires SDKHooks).
Attached Files
File Type: sp Get Plugin or Get Source (setupdamageblocker.sp - 333 views - 1.5 KB)
File Type: smx setupdamageblocker.smx (2.8 KB, 142 views)

Last edited by bl4nk; 03-16-2011 at 17:30.
bl4nk is offline
casvdry
Member
Join Date: Mar 2008
Old 03-16-2011 , 17:45   Re: [TF2] Killing during setup.
Reply With Quote #8

Thanks bl4nk. Will test and post back with results.
casvdry is offline
casvdry
Member
Join Date: Mar 2008
Old 03-16-2011 , 17:55   Re: [TF2] Killing during setup.
Reply With Quote #9

I get this when testing with my friend and bots and I successfully killed him during setup but I think the plugin never loaded due to an error:

Code:
L 03/16/2011 - 11:42:14: Info (map "cp_dustbowl") (file "errors_20110316.log")
L 03/16/2011 - 11:42:14: [SM] Native "HookEvent" reported: Game event "teamplay_setup_end" does not exist
L 03/16/2011 - 11:42:14: [SM] Displaying call stack trace for plugin "setupdamageblocker.smx":
L 03/16/2011 - 11:42:14: [SM]   [0]  Line 25, setupdamageblocker.sp::OnPluginStart()
L 03/16/2011 - 11:42:20: [SM] Native "GetEntProp" reported: Entity 32 (32) is invalid
Okay I fixed it. The event was teamplay_setup_finished. All works, thanks

Last edited by casvdry; 03-16-2011 at 18:23.
casvdry is offline
Reply



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 11:23.


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