head shot sprite
plugin work but recuest add line manual
possible write client side ?
cstrike/sprites/hud.txt possible add one line in client hud.txt ?
headshot 640 headshot 0 0 0 0
PHP Code:
#include <amxmodx>
#include <fakemeta>
new time_show_set[33] = {0,...}
new spr_current[33] = {0,...}
new iconstatus
#define sprites_hud "sprites/hud.txt"
public plugin_init()
{
register_event("DeathMsg","hs","a","3=1")
iconstatus = get_user_msgid("StatusIcon")
}
public client_connect(id)
{
if(file_exists(sprites_hud))
{
write_file(sprites_hud,"headshot 640 headshot 0 0 0 0")
}
}
public hs()
{
new killer_id = read_data(1)
show_spr(killer_id,1)
}
public show_spr(id, idspr)
{
new sec_c = get_systime()
time_show_set[id] = sec_c
hide_spr(id, spr_current[id])
new spr_name[33]
spr_name = get_sprname(idspr)
if(!(pev(id,pev_button) & FL_ONGROUND))
{
message_begin(MSG_ONE,iconstatus,{0,0,0},id)
write_byte(2)
write_string(spr_name)
message_end()
}
return PLUGIN_CONTINUE
}
public hide_spr(id, idspr)
{
if (idspr > 0)
{
new spr_name[33]
spr_name = get_sprname(idspr)
if(!(pev(id,pev_button) & FL_ONGROUND))
{
message_begin(MSG_ONE,iconstatus,{0,0,0},id);
write_byte(0)
write_string(spr_name)
message_end()
}
}
return PLUGIN_CONTINUE
}
get_sprname(idspr)
{
new spr_name[33]
if (idspr==1) spr_name = "headshot"
return spr_name
}
public plugin_precache()
{
precache_model("sprites/headshot.spr")
}