#include <sdktools>
#pragma newdecls required
#define SOUND_LOAD "sound/custom/ur.mp3"
#define SOUND_PLAY "*/custom/ur.mp3"
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public void OnMapStart()
{
PrecacheSound(SOUND_PLAY, true);
AddFileToDownloadsTable(SOUND_LOAD);
}
public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
if (GetEventBool(event, "headshot"))
{
// Get all required event info
int attackerIndex = GetClientOfUserId(GetEventInt(event, "attacker"));
// Emit sound
EmitSoundToClient(attackerIndex, SOUND_PLAY, SOUND_FROM_PLAYER, SNDCHAN_STATIC, SNDLEVEL_NORMAL);
}
}