#include #include #include #include #include new normal_kill new level[32] new bool:kills[32] public plugin_precache() { normal_kill = precache_model("sprites/normal_kill.spr") } public plugin_init() { register_plugin("Death Sprite Effect","1.5","RaZzoR") register_event("DeathMsg","onDeath","a") } public client_disconnect(id) { level[id]= 0 } public client_putinserver(id) { level[id]= 0 } public onDeath() { new name_attacker[32] new name_victim[32] new wpn[3] new attacker = read_data(1) new victim = read_data(2) get_user_name(attacker, name_attacker, 31) get_user_name(victim, name_victim, 31) read_data(4,wpn,2) if ( wpn[0] != wpn[1] != 'r') { show_sprite(victim, normal_kill) } return PLUGIN_CONTINUE } public show_sprite(attacker, sprite) { if(!is_user_connected(attacker)) return PLUGIN_CONTINUE static origin[3] get_user_origin(attacker, origin) message_begin(MSG_PVS, SVC_TEMPENTITY, origin) write_byte(TE_SPRITE) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]+65) write_short(sprite) write_byte(10) write_byte(250) message_end() return PLUGIN_CONTINUE } public podesi_boolove(id) { kills[id] = false } bool:can_see_fm(entindex1, entindex2) { if (!entindex1 || !entindex2) return false 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 } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang5121\\ f0\\ fs16 \n\\ par } */