this is kill effects acg xphere plugin ...
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <acg>
#define LEVELS 8
new kills[33], Float:timekill[33], revenge[33], oneshot[33]
new g_firstkill, g_lastkill
new const tga_combo[][] =
{
"gfx/effectskill/1shot_2kill.tga",
"gfx/effectskill/1shot_3kill.tga",
"gfx/effectskill/c4_defuse.tga",
"gfx/effectskill/c4_set.tga",
"gfx/effectskill/kill_1.tga",
"gfx/effectskill/kill_2.tga",
"gfx/effectskill/kill_3.tga",
"gfx/effectskill/kill_4.tga",
"gfx/effectskill/kill_5.tga",
"gfx/effectskill/kill_6.tga",
"gfx/effectskill/kill_7.tga",
"gfx/effectskill/kill_8.tga",
"gfx/effectskill/kill_first.tga",
"gfx/effectskill/kill_he.tga.tga",
"gfx/effectskill/kill_headshot.tga",
"gfx/effectskill/kill_knife.tga",
"gfx/effectskill/kill_last.tga",
"gfx/effectskill/kill_revenge.tga",
"gfx/effectskill/wall_shot.tga",
"gfx/effectskill/wall_shot_hs.tga"
}
new const tga_combo2[][] =
{
"gfx/effectskill/1shot_2kill.tga",
"gfx/effectskill/1shot_3kill.tga",
"gfx/effectskill/c4_defuse.tga",
"gfx/effectskill/c4_set.tga",
"gfx/effectskill/kill_1.tga",
"gfx/effectskill/kill_2.tga",
"gfx/effectskill/kill_3.tga",
"gfx/effectskill/kill_4.tga",
"gfx/effectskill/kill_5.tga",
"gfx/effectskill/kill_6.tga",
"gfx/effectskill/kill_7.tga",
"gfx/effectskill/kill_8.tga",
"gfx/effectskill/kill_first.tga",
"gfx/effectskill/kill_he.tga.tga",
"gfx/effectskill/kill_headshot.tga",
"gfx/effectskill/kill_knife.tga",
"gfx/effectskill/kill_last.tga",
"gfx/effectskill/kill_revenge.tga",
"gfx/effectskill/wall_shot.tga",
"gfx/effectskill/wall_shot_hs.tga"
}
enum
{
KILL_1 = 0,
KILL_2,
KILL_3,
KILL_4,
KILL_5,
KILL_6,
KILL_7,
KILL_8,
KILL_FIRST,
C4_DEFUSE,
C4_SET,
KILL_HEGRENADE,
KILL_HEADSHOT,
KILL_KNIFE,
KILL_LAST,
KILL_REVENGE,
WALLSHOT,
WALLSHOT_HEADSHOT,
ONESHOT_2KILL,
ONESHOT_3KILL
}
public plugin_precahce()
{
for (new i = 0; i <= 17; i++)
{
precache_generic(tga_combo[i])
}
}
public plugin_init()
{
register_plugin("Effects Kill", "0.2", "modified from CSO-NST")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("DeathMsg", "event_DeathMsg", "a")
}
public event_round_start()
{
new reset_value[33]
g_firstkill = 1
kills = reset_value
revenge = reset_value
oneshot = reset_value
}
public event_DeathMsg()
{
// get value data
static killer, headshot, weapon[32], wpnindex, victim
killer = read_data(1)
victim = read_data(2)
headshot = read_data(3)
read_data(4, weapon, charsmax(weapon))
if (equali(weapon, "grenade"))
format(weapon, charsmax(weapon), "hegrenade")
format(weapon, charsmax(weapon), "weapon_%s", weapon)
wpnindex = get_weaponid(weapon)
// none killer = victim
if (!is_user_connected(killer) || !is_user_connected(victim) || killer==victim) return;
if (!acg_userstatus(killer))
{
if (g_firstkill)
g_firstkill = 0
return;
}
//if (get_user_team(killer)==get_user_team(victim) && !get_cvar_num("mp_friendlyfire")) return;
// reset kills of victim
kills[victim] = 0
// set revenge of victim
revenge[victim] = killer
// get num kill & one shoot multikill
new Float:timeleft = get_gametime()-timekill[killer]
if (timeleft <= 3.0) kills[killer] += 1
else kills[killer] = 1
if (kills[killer]>LEVELS) kills[killer] = LEVELS
timekill[killer] = get_gametime()
if (!oneshot[killer]) oneshot[killer] = 1
if (!timeleft && wpnindex != CSW_HEGRENADE) oneshot[killer] += 1
else oneshot[killer] = 1
oneshot[killer] = min(3, oneshot[killer])
//client_print(killer, print_chat, "%i", oneshot[killer])
// get last kill
new players_ct[32], players_t[32], ict, ite
get_players(players_ct,ict,"ae","CT")
get_players(players_t,ite,"ae","TERRORIST")
if (ict == 0 || ite == 0) g_lastkill = 1
// check revenge
new m_revenge
if (victim == revenge[killer])
{
m_revenge = 1
revenge[killer] = 0
}
if (oneshot[killer] > 1)
{
if (oneshot[killer] == 2)
acg_drawtga(killer, tga_combo2[ONESHOT_2KILL], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 1)
else if (oneshot[killer] == 3)
acg_drawtga(killer, tga_combo2[ONESHOT_3KILL], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 1)
}
if (g_lastkill)
{
g_lastkill = 0
acg_drawtga(killer, tga_combo2[KILL_LAST], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 2)
}
if (m_revenge)
acg_drawtga(killer, tga_combo2[KILL_REVENGE], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 3)
if ((wpnindex != CSW_KNIFE) && (wpnindex != CSW_HEGRENADE) && !can_see_fm(killer, victim))
{
if (headshot)
acg_drawtga(killer, tga_combo2[WALLSHOT_HEADSHOT], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 4)
else
acg_drawtga(killer, tga_combo2[WALLSHOT], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 4)
}
if (headshot && wpnindex)
{
acg_drawtga(killer, tga_combo2[KILL_HEADSHOT], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 5)
}
else if (wpnindex == CSW_KNIFE)
{
acg_drawtga(killer, tga_combo2[KILL_KNIFE], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 5)
}
else if (wpnindex == CSW_HEGRENADE)
{
acg_drawtga(killer, tga_combo2[KILL_HEGRENADE], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 5)
}
// hud 2
if (g_firstkill)
{
g_firstkill = 0
acg_drawtga(killer, tga_combo2[KILL_FIRST], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 6)
}
else
{
acg_drawtga(killer, tga_combo2[kills[killer] - 1], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 6)
}
}
public bomb_defused(id)
{
acg_drawtga(id, tga_combo2[C4_DEFUSE], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 7)
}
public bomb_planted(id)
{
acg_drawtga(id, tga_combo2[C4_SET], 255, 255, 255, 255, 0.5, 0.3, 1, FX_NONE, 0.0, 0.0, 0.0, 4.5, 0, 0, 7)
}
bool:can_see_fm(entindex1, entindex2)
{
if (!entindex1 || !entindex2)
return false
// new ent1, ent2
if (pev_valid(entindex1) && pev_valid(entindex1))
{
new flags = pev(entindex1, pev_flags)
if (flags & EF_NODRAW || flags & FL_NOTARGET)
{
return false
}
new Float:lookerOrig[3]
new Float:targetBaseOrig[3]
new Float:targetOrig[3]
new Float:temp[3]
pev(entindex1, pev_origin, lookerOrig)
pev(entindex1, pev_view_ofs, temp)
lookerOrig[0] += temp[0]
lookerOrig[1] += temp[1]
lookerOrig[2] += temp[2]
pev(entindex2, pev_origin, targetBaseOrig)
pev(entindex2, pev_view_ofs, temp)
targetOrig[0] = targetBaseOrig [0] + temp[0]
targetOrig[1] = targetBaseOrig [1] + temp[1]
targetOrig[2] = targetBaseOrig [2] + temp[2]
engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the had of seen player
if (get_tr2(0, TraceResult:TR_InOpen) && get_tr2(0, TraceResult:TR_InWater))
{
return false
}
else
{
new Float:flFraction
get_tr2(0, TraceResult:TR_flFraction, flFraction)
if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
{
return true
}
else
{
targetOrig[0] = targetBaseOrig [0]
targetOrig[1] = targetBaseOrig [1]
targetOrig[2] = targetBaseOrig [2]
engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the body of seen player
get_tr2(0, TraceResult:TR_flFraction, flFraction)
if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
{
return true
}
else
{
targetOrig[0] = targetBaseOrig [0]
targetOrig[1] = targetBaseOrig [1]
targetOrig[2] = targetBaseOrig [2] - 17.0
engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, entindex1, 0) // checks the legs of seen player
get_tr2(0, TraceResult:TR_flFraction, flFraction)
if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == entindex2))
{
return true
}
}
}
}
}
return false
}