49 lines
1.1 KiB
Plaintext
49 lines
1.1 KiB
Plaintext
|
#include <amxmodx>
|
||
|
#include <hamsandwich>
|
||
|
#include <engine>
|
||
|
|
||
|
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;
|
||
|
}
|