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