#include <amxmodx>
#include <reapi>
new HEADSHOT[][] = {
"effect_kill/headshot.wav",
"effect_kill/headshot1.wav"
};
public plugin_init() {
RegisterHookChain(RG_CSGameRules_PlayerKilled, "CSGameRules_PlayerKilled_Post", true);
}
public plugin_precache() {
for(new a = 0; a < sizeof(HEADSHOT); a++) {
precache_sound(HEADSHOT[a]);
}
}
public CSGameRules_PlayerKilled_Post( pVictim, pKiller, inflictor) {
if (!is_user_connected(pKiller) || pVictim == pKiller)
return;
if(get_member(pVictim, m_bHeadshotKilled)) {
rh_emit_sound2(pKiller, 0, CHAN_STATIC, HEADSHOT[ random_num(0, charsmax(HEADSHOT)) ]);
}
}