Raised This Month: $ Target: $400
 0% 

break_prop event, EventHookMode_Pre, preventing prop damage by team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scuzzy
Senior Member
Join Date: Oct 2007
Old 10-20-2009 , 14:29   break_prop event, EventHookMode_Pre, preventing prop damage by team
Reply With Quote #1

This is for HL2, non-OB engine.

So I have this prop that I've generated. I want to prevent this prop from taking damage from the team that created it, only enemy teams.

I know that you can hook the pre-fire event for player_say and prevent text from being displayed by returning Plugin_Handled. I figured I"d give this a shot with the pre-fire of break_prop.

Code:
 HookEvent("break_prop", Event_Breakable_Pre, EventHookMode_Pre);
...
public Action:Event_Breakable_Pre(Handle:event, const String:name[], bool:dontBroadcast)
{
 LogMessage("Hit Breakable");
 PrintToServer("Hit Breakable");
 // surpress the game entered message.
 return Plugin_Handled;
}
I figured, in the code above, I'd pull the TeamNum off the entity and compare it with the TeamNum of the client doing the damage, then just return Plugin_Handled to prevent the breaking from occurruing.

It did not work.

There don't appear to be any generic "hit_prop" events, where I could just up the hp of the prop if it was damaged by a team member.

How do I trap and prevent damage to a prop?

Scuzzy
Scuzzy is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 10-20-2009 , 16:06   Re: break_prop event, EventHookMode_Pre, preventing prop damage by team
Reply With Quote #2

Just hook the OnTakeDamage output on the entity and check the team of the inflictor. If it's the wrong team, set the health of the object back to what it was previously.
bl4nk is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 10-20-2009 , 16:52   Re: break_prop event, EventHookMode_Pre, preventing prop damage by team
Reply With Quote #3

Quote:
Originally Posted by bl4nk View Post
Just hook the OnTakeDamage output on the entity and check the team of the inflictor. If it's the wrong team, set the health of the object back to what it was previously.
That was my first attempt, but I was trying another way to do it. Entity outputs are apparently disabled in FF, I get a "Native "HookSingleEntityOutput" reported: Entity Outputs are disabled" message when I try that.
Scuzzy is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 10-21-2009 , 12:39   Re: break_prop event, EventHookMode_Pre, preventing prop damage by team
Reply With Quote #4

Looks like the FF gamedata is missing the Signature for FireOutput.
bl4nk is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 10-21-2009 , 13:38   Re: break_prop event, EventHookMode_Pre, preventing prop damage by team
Reply With Quote #5

Quote:
Originally Posted by bl4nk View Post
Looks like the FF gamedata is missing the Signature for FireOutput.
Is that mod.dll specific and I should create a bug-fix request for SourceMod, or is this something I could fix by adding "ff" as a game in the engine.ep1.txt? I'm... unfamiliar with gamedata files.

Scuzzy
Scuzzy is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 10-22-2009 , 10:54   Re: break_prop event, EventHookMode_Pre, preventing prop damage by team
Reply With Quote #6

Guess there is a third option, that this is something the FF dev team would provide SourceMod? Any ideas from the galley?

Scuzzy
Scuzzy 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 01:06.


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