diff --git a/getout.wav b/getout.wav new file mode 100644 index 0000000..4932db9 Binary files /dev/null and b/getout.wav differ diff --git a/headshot.sma b/headshot.sma new file mode 100644 index 0000000..0219aee --- /dev/null +++ b/headshot.sma @@ -0,0 +1,48 @@ +#include +#include +#include + +public plugin_precache() +{ + precache_sound("misc/headshot.wav"); + precache_sound("misc/getout.wav"); +} + +public plugin_init() +{ + register_plugin("headshot", "1.0", "bacalhau"); + register_event("DeathMsg", "headshot_detected", "a"); +} + +public headshot_detected() +{ + new victim = read_data(2); + new killer = read_data(1); + + if (read_data(3)) + { + client_cmd(killer, "play misc/headshot.wav"); + message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0, 0, 0}, killer); + write_short(1024); + write_short(1024); + write_short(0); + write_byte(0); + write_byte(200); + write_byte(0); + write_byte(75); + message_end(); + + client_cmd(victim, "play misc/getout.wav"); + message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0, 0, 0}, victim); + write_short(1024); + write_short(1024); + write_short(0); + write_byte(255); + write_byte(0); + write_byte(0); + write_byte(75); + message_end(); + } + + return PLUGIN_CONTINUE; +} diff --git a/headshot.wav b/headshot.wav new file mode 100644 index 0000000..9d2e3a3 Binary files /dev/null and b/headshot.wav differ