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

Solved How to block body impacts?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 10-18-2018 , 01:40   How to block body impacts?
Reply With Quote #1

I know it is possible to block the whole shot with SDKHook_TraceAttack!

But I need the shot connecting and just want to block the sound of the bodyhit. Blocking the whole aimpunch would be okay as well as long as the shot is not deleted and still connecting.

Tried to work with
AddTempEntHook("Impact", TE_Impact);
and
NormalSoundHook
Maybe I've made a mistake, otherwise these bodyhits are not hooked by these functions.

Anyone with an idea or knowledge that might help?

edit: the game is csgo

Last edited by fragnichtnach; 10-20-2018 at 12:46. Reason: added information
fragnichtnach is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-18-2018 , 04:09   Re: How to block body impacts?
Reply With Quote #2

What about hooking take damage _alive and returning plugin stop while editing the victims health manually?
__________________

Last edited by Neuro Toxin; 10-18-2018 at 04:09.
Neuro Toxin is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 10-18-2018 , 09:46   Re: How to block body impacts?
Reply With Quote #3

Just tested, no still played. I thaught it might work by stopping the plugin at SDKHook_TraceAttack (at this point the damage isn't yet calculated correctly by CS:GO). But I was wrong. The body impact sound is played even if I use this code:

Code:
#include <sdktools> 
#include <sdkhooks>

public OnPluginStart()
{
    AddTempEntHook("Shotgun Shot", Hook_ShotgunShot);
}
public Action Hook_ShotgunShot(const char[] te_name, const int[] players, int numClients, float delay)
{
    return Plugin_Stop;
}

public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); //unklar ob man das hier braucht
    //SDKHook(client, SDKHook_OnTakeDamageAlive, OnTakeDamage); //unklar ob man das hier braucht
    SDKHook(client, SDKHook_TraceAttack, OnTraceAttack); //unklar ob man das hier braucht
}

public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3])
{
    PrintToChatAll("OnTakeDamage Damagetype=%d (%f.1)", damagetype, damage);
    return Plugin_Handled;
}
public Action:OnTraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
{
    PrintToChatAll("OnTraceAttack Damagetype=%d (%f.1)", damagetype, damage);
    return Plugin_Stop;
}

Last edited by fragnichtnach; 10-18-2018 at 10:36. Reason: added information
fragnichtnach is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-18-2018 , 17:30   Re: How to block body impacts?
Reply With Quote #4

...but are these again client side sounds ? Server not handle those ? Same as blood decals

*edit
ok, those are played by server after all
Spoiler
Attached Thumbnails
Click image for larger version

Name:	20181019004844_1.png
Views:	277
Size:	65.8 KB
ID:	171890  

Last edited by Bacardi; 10-18-2018 at 17:57.
Bacardi is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-18-2018 , 17:57   Re: How to block body impacts?
Reply With Quote #5

Sounds like it could be client prediction.

OP. turn off prediction for a minute and see if either attempts work
__________________
Neuro Toxin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-18-2018 , 18:01   Re: How to block body impacts?
Reply With Quote #6

those sounds start with
Code:
~player\
~)player\
Try hook those.. ?


those are played like:
~player\kevlar1.wav
~player\headshot2.wav
__________________
Do not Private Message @me
Bacardi is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 10-19-2018 , 02:56   Re: How to block body impacts?
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
those sounds start with
Code:
~player\
~)player\
Try hook those.. ?


those are played like:
~player\kevlar1.wav
~player\headshot2.wav
Thankyou very much for your input. I've just tested this code:
Code:
public OnPluginStart()
{
    AddTempEntHook("Shotgun Shot", Hook_ShotgunShot);
    AddNormalSoundHook(Hook_NormalSound);
    AddAmbientSoundHook(Hook_AmbiantSound);
}
public Action:Hook_NormalSound(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
{
    return Plugin_Stop;
}
public Action:Hook_AmbiantSound(String:sample[PLATFORM_MAX_PATH], &entity, &Float:volume, &level, &pitch, Float:pos[3], &flags, &Float:delay)
{
    return Plugin_Stop;
}
public Action Hook_ShotgunShot(const char[] te_name, const int[] players, int numClients, float delay)
{
    return Plugin_Stop;
}
The body impacts are still being played. Am I doing sth. wrong in hooking these sounds.



Quote:
Originally Posted by Neuro Toxin View Post
Sounds like it could be client prediction.

OP. turn off prediction for a minute and see if either attempts work
As well I tested it with bots shooting on bots and I was just listening. So I think it is not client prediction, is it?

Last edited by fragnichtnach; 10-19-2018 at 02:57.
fragnichtnach is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-19-2018 , 04:34   Re: How to block body impacts?
Reply With Quote #8

...I need to test myself :s

*edit
Ok... you can block just part of those impact sounds with NormalSoundHook. But rest "physic impact" sounds are client side. :/

Last edited by Bacardi; 10-19-2018 at 05:15.
Bacardi is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 10-19-2018 , 05:27   Re: How to block body impacts?
Reply With Quote #9

Quote:
Originally Posted by Bacardi View Post
...I need to test myself :s

*edit
Ok... you can block just part of those impact sounds with NormalSoundHook. But rest "physic impact" sounds are client side. :/
And there is no way to block the "physic impact" or change it? Or maybe change the sound?

I saw there was an cvar-option in the deathmatch plugin from h3bus. It was working with the extention dhooks. But I've tested it and it seems not to be working. Body impacts are still played. the plugin is quiet old. I think it was working in the past but a csgo update broke it.

Last edited by fragnichtnach; 10-19-2018 at 05:28.
fragnichtnach is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-19-2018 , 08:43   Re: How to block body impacts?
Reply With Quote #10

You can try. I watch that it use DHooks and "DoImpactEffect" offset. I have not tested :/
Bacardi 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 02:38.


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