|
Junior Member
|

09-22-2015
, 13:22
Re: ..::need help::...::plugin not work::..
|
#1
|
Quote:
Originally Posted by redivcram
When you trigger something inside the plugin, anything, even the function to draw the tga, do you get any errors in console?
|
the plugin work now not 100% yet maybe 50%
i need to add
kill_1
kill_2
kill_3
kill_4
kill_5
kill_6
kill_7
kill_8
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 public plugin_precache() { precache_generic("gfx/effectskill/1shot_2kill.tga") precache_generic("gfx/effectskill/1shot_3kill.tga") precache_generic("gfx/effectskill/c4_defuse.tga") precache_generic("gfx/effectskill/c4_set.tga") precache_generic("gfx/effectskill/kill_1.tga") precache_generic("gfx/effectskill/kill_2.tga") precache_generic("gfx/effectskill/kill_3.tga") precache_generic("gfx/effectskill/kill_4.tga") precache_generic("gfx/effectskill/kill_5.tga") precache_generic("gfx/effectskill/kill_6.tga") precache_generic("gfx/effectskill/kill_7.tga") precache_generic("gfx/effectskill/kill_8.tga") precache_generic("gfx/effectskill/kill_first.tga") precache_generic("gfx/effectskill/kill_he.tga.tga") precache_generic("gfx/effectskill/kill_headshot.tga") precache_generic("gfx/effectskill/kill_knife.tga") precache_generic("gfx/effectskill/kill_last.tga") precache_generic("gfx/effectskill/kill_revenge.tga") precache_generic("gfx/effectskill/wall_shot.tga") precache_generic("gfx/effectskill/wall_shot_hs.tga") } 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, "gfx/effectskill/1shot_2kill.tga", 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, "gfx/effectskill/1shot_3kill.tga", 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, "gfx/effectskill/kill_last.tga", 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, "gfx/effectskill/kill_revenge.tga", 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, "gfx/effectskill/wall_shot_hs.tga", 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, "gfx/effectskill/wall_shot.tga", 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, "gfx/effectskill/kill_headshot.tga", 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, "gfx/effectskill/kill_knife.tga", 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, "gfx/effectskill/kill_he.tga.tga", 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, "gfx/effectskill/kill_first.tga", 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, "gfx/effectskill/c4_defuse.tga", 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, "gfx/effectskill/c4_set.tga", 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 }
|
|