#include <amxmodx>
new g_sprite;
public plugin_init()
{
register_plugin("Death-info beams", "3.0", "BMJ");
register_event("CS_DeathMsg", "death_msg", "a");
register_cvar("amx_dib_holdtime", "200");
register_cvar("amx_dib_width", "10");
register_cvar("amx_dib_cross", "30");
register_cvar("amx_dib_color", "000255000");
}
public plugin_precache()
{
g_sprite = precache_model("sprites/dot.spr");
}
public death_msg()
{
new killer = read_data(1);
new victim = read_data(2);
if (killer == victim)
return PLUGIN_HANDLED;
new vec_killer[3];
new vec_victim[3];
get_user_origin(killer, vec_killer, 1);
get_user_origin(victim, vec_victim);
new color[12];
get_cvar_string("amx_dib_color", color, 11);
new b = str_to_num(color[6]);
color[6] = 0;
new g = str_to_num(color[3]);
color[3] = 0;
new r = str_to_num(color[0]);
new size = get_cvar_num("amx_dib_cross");
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_killer[0] + size);
write_coord(vec_killer[1]);
write_coord(vec_killer[2]);
write_coord(vec_killer[0] - size);
write_coord(vec_killer[1]);
write_coord(vec_killer[2]);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
if (get_user_team(killer) == 1)
{
write_byte(255);
write_byte(50);
write_byte(50);
}
else
{
write_byte(100);
write_byte(100);
write_byte(255);
}
write_byte(100);
write_byte(0);
message_end();
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_killer[0]);
write_coord(vec_killer[1] + size);
write_coord(vec_killer[2]);
write_coord(vec_killer[0]);
write_coord(vec_killer[1] - size);
write_coord(vec_killer[2]);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
if (get_user_team(killer) == 1)
{
write_byte(255);
write_byte(50);
write_byte(50);
}
else
{
write_byte(100);
write_byte(100);
write_byte(255);
}
write_byte(100);
write_byte(0);
message_end();
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_killer[0]);
write_coord(vec_killer[1]);
write_coord(vec_killer[2] + size);
write_coord(vec_killer[0]);
write_coord(vec_killer[1]);
write_coord(vec_killer[2] - size);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
if (get_user_team(killer) == 1)
{
write_byte(255);
write_byte(50);
write_byte(50);
}
else
{
write_byte(100);
write_byte(100);
write_byte(255);
}
write_byte(100);
write_byte(0);
message_end();
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_victim[0] + size);
write_coord(vec_victim[1]);
write_coord(vec_victim[2]);
write_coord(vec_victim[0] - size);
write_coord(vec_victim[1]);
write_coord(vec_victim[2]);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
if (get_user_team(victim) == 1)
{
write_byte(255);
write_byte(50);
write_byte(50);
}
else
{
write_byte(100);
write_byte(100);
write_byte(255);
}
write_byte(100);
write_byte(0);
message_end();
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_victim[0]);
write_coord(vec_victim[1] + size);
write_coord(vec_victim[2]);
write_coord(vec_victim[0]);
write_coord(vec_victim[1] - size);
write_coord(vec_victim[2]);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
if (get_user_team(victim) == 1)
{
write_byte(255);
write_byte(50);
write_byte(50);
}
else
{
write_byte(50);
write_byte(50);
write_byte(255);
}
write_byte(100);
write_byte(0);
message_end();
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_victim[0]);
write_coord(vec_victim[1]);
write_coord(vec_victim[2] + size);
write_coord(vec_victim[0]);
write_coord(vec_victim[1]);
write_coord(vec_victim[2] - size);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
if (get_user_team(victim) == 1)
{
write_byte(255);
write_byte(50);
write_byte(50);
}
else
{
write_byte(100);
write_byte(100);
write_byte(255);
}
write_byte(100);
write_byte(0);
message_end();
message_begin(MSG_ONE, SVC_TEMPENTITY, {0, 0, 0}, victim);
write_byte(0);
write_coord(vec_killer[0]);
write_coord(vec_killer[1]);
write_coord(vec_killer[2]);
write_coord(vec_victim[0]);
write_coord(vec_victim[1]);
write_coord(vec_victim[2]);
write_short(g_sprite);
write_byte(1);
write_byte(1);
write_byte(get_cvar_num("amx_dib_holdtime")); // x 0.1
write_byte(get_cvar_num("amx_dib_width")); // x 0.1
write_byte(0);
write_byte(r);
write_byte(g);
write_byte(b);
write_byte(100);
write_byte(0);
message_end();
return PLUGIN_HANDLED;
}