I don't think there is a hook. You can try this although there is an issue with it.
It works but getting the entity(sentry/dispenser/teleporter) isn't reliable since you can hit the building without looking at it. If you don't need the entity then you can delete GetClientAimTarget and your good to go. If you do need the entity maybe someone else knows a better way.
Code:
public void OnPluginStart()
{
AddNormalSoundHook(Hook_EntitySound);
}
public Action Hook_EntitySound(
int clients[64],
int &numClients,
char sample[PLATFORM_MAX_PATH],
int &client,
int &channel,
float &volume,
int &level,
int &pitch,
int &flags)
{
if(StrEqual(sample, "weapons/wrench_hit_build_fail.wav")
|| StrEqual(sample, "weapons/wrench_hit_build_success1.wav")
|| StrEqual(sample, "weapons/wrench_hit_build_success2.wav"))
{
int entity = GetClientAimTarget(client, false);
if(!IsValidEntity(entity))
return Plugin_Continue;
PrintToChat(client, "Building Hit! Client:%d Entity:%d", client, entity);
}
return Plugin_Continue;
}
__________________