The file you're looking for is sound/materials.txt, it assigns materials to each texture. The file contains an explanation as to how it works.
Codewise you need to consider a few things:
https://github.com/ValveSoftware/halflife/blob/master/pm_shared/pm_shared.c#L191https://github.com/ValveSoftware/halflife/blob/master/dlls/sound.cpp#L1539The same code is in 2 places, the former is used by physics code on both the client and server side, the latter is only used on the server side to handle things like crowbar hitting a wooden box sort of thing.
Adding new materials is a bit clunky, bear with me:
First you need to define a constant used to identify it, that's done in 2 places:
https://github.com/ValveSoftware/halflife/blob/master/pm_shared/pm_materials.h#L21https://github.com/ValveSoftware/halflife/blob/master/pm_shared/pm_shared.c#L92You also need to define a constant that this first one gets converted to so it can be used more easily:
https://github.com/ValveSoftware/halflife/blob/master/pm_shared/pm_shared.c#L104Converted in this function:
https://github.com/ValveSoftware/halflife/blob/master/pm_shared/pm_shared.c#L441Now you need to handle the actual sound playback. This time it's in 3 places:
https://github.com/ValveSoftware/halflife/blob/master/pm_shared/pm_shared.c#L322https://github.com/ValveSoftware/halflife/blob/master/dlls/sound.cpp#L1687https://github.com/ValveSoftware/halflife/blob/master/cl_dll/ev_hldm.cpp#L156All are identical but use different ways to do it due to different engine interfaces.
Yes, it sucks, it should be easier, but this is GoldSource.
If you need help i can quickly clean this up and make it use a single definition for everything, and bypass the hardcoded limits too if you need it.