PDA

View Full Version : Blocking player_hurt CS:S


NeWsOfTzzz
05-02-2009, 12:41
I followed the event tutorial but this doesn't really work:

public OnPluginStart()
{
HookEvent("player_hurt", Event_PlayerHurt, EventHookMode_Pre);
}

public Action:Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
return Plugin_Handled;
}I need this to build a headshot only mod, like those which already exist, but I don't want the slowdowns when you get hit into the stomach. I know this is possible, because I know a server using it.

So how do I fully block the whole player-being-hurt process and the weapon impact functions?

MikeJS
05-02-2009, 13:00
Dukehacks (http://forums.alliedmods.net/showthread.php?t=69658)

psychonic
05-02-2009, 13:37
Events themselves are just for updating things like the HUD.

Blocking the event will not actually block the damage. You can use Dukehacks or you can add health back to the player in the amount that they were hurt which will work in most cases.

NeWsOfTzzz
05-04-2009, 10:13
I've found a hitgroup restriction which worked with something like dukehacks, I managed to get it running.

Now I'd like to switch to dukehacks, since it's 2 years newer. To block the event the function "TraceAttack" was blocked but in dukehacks' description is written:
"TraceAttack // deprecated (use TakeDamage)!"

Is there a reference about these functions? So I can see parameters, description and so on?