You can add an event to tell the client to play a sound. You can also precache the hitsounds depending on what you allow the client to do (select custom hitsounds for
exemple).
An exemple of achieving this is to
- Add an event in bg_public.h
- Modify the function G_Damage() in g_combat.c in order to send an event to the attacker
when he hit someone. If using the same event for all hitsounds you then use event_parm
to specify what type of hitsound to play.
- in the media member of the cgs_t struct add some sound handles for your hitsound.
Register them in CG_RegisterSounds() in cg_main.c
- Modify the function CG_EntityEvent() in cg_event.c so that your hitsound event can be
handled by the client.
Be aware that:
-If not running a pure server, the clients can connect with an improper client dll which
may result as them beeing disconnected with an unknow event xx error message or
the events not beeing correctly handled or crashs depending on what you have done
with events ( add/del/changed order ).
-If not having done shrub mod or etpro mod you will receive messages from MadJack
trying to tell the world that your mod works in a strange way.