#define USE_AMX #if defined USE_AMX #include #include #else #include #include #endif new gMsgScreenShake , gMsgScreenFade; new bool:heplayerflag[33]; #define CVAR_STATUS "he_damage_effect" new g_heomfg[33] new g_hefx1[33] //updated names from past versions new g_hefx2[33] new g_hefx3[33] public plugin_init() { register_plugin("HE damage effect" , "0.3" , "Change by Kurt"); register_event("Damage" , "event_Damage" , "b" , "2>0"); register_cvar(CVAR_STATUS , "1"); gMsgScreenShake = get_user_msgid("ScreenShake"); gMsgScreenFade = get_user_msgid("ScreenFade"); } public plugin_precache() { precache_sound("voi/voi_heffect2.wav") precache_sound("voi/heartbeat_voi.wav") precache_sound("voi/breathe_voi.wav") precache_sound("hgrunt/gr_pain4.wav") } public client_putinserver(id) heplayerflag[id] = false; public client_disconnect(id) heplayerflag[id] = false; #define PA_LOW 25.0 #define PA_HIGH 50.0 public event_Damage(id) { if(get_cvar_num(CVAR_STATUS) <= 0 || !is_user_connected(id) || !is_user_alive(id) || is_user_bot(id)) return; new iWeapID, attacker = get_user_attacker(id , iWeapID); if(!is_user_connected(attacker)) return; if(iWeapID == 4) { new Float:fVec[3]; fVec[0] = random_float(PA_LOW , PA_HIGH); fVec[1] = random_float(PA_LOW , PA_HIGH); fVec[2] = random_float(PA_LOW , PA_HIGH); entity_set_vector(id , EV_VEC_punchangle , fVec); message_begin(MSG_ONE , gMsgScreenShake , {0,0,0} ,id) write_short( 1<<14 ); write_short( 1<<14 ); write_short( 1<<14 ); message_end(); message_begin(MSG_ONE_UNRELIABLE , gMsgScreenFade , {0,0,0} , id); write_short( 1<<10 ); write_short( 1<<10 ); write_short( 1<<12 ); write_byte( 225 ); write_byte( 0 ); write_byte( 0 ); write_byte( 125 ); message_end(); set_task(1.5,"omgivebeenhe",id) //stunned this long then waking+heartbeat and breathe sounds set_task(6.5,"he_effectsfade1",id) //fading of echo client_cmd(id,"room_type 6;room_delay 0.3;room_lp 1;room_mod 5;room_feedback 0.85;room_size 0.9;room_left 0.5;room_refl 2") // client_cmd(id,"room_type 7") //those nice echo effects like on de_rats + tweaked // client_cmd(id,"room_lp 1") //effect - some kind of filter //hope this few lines doesnt make overflows // client_cmd(id,"room_mod 1") //effect - modulation // client_cmd(id,"room_size 0.5") //effect - size of the room echo(and how long the sound is "bounced) // client_cmd(id,"room_left 0.1") //effect - nice stereo delay // client_cmd(id,"room_refl 2") //effect - all LOUDER! emit_sound(id, CHAN_AUTO, "hgrunt/gr_pain4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) set_task(1.0,"he_loudyeffectstop",id) set_task(8.1,"he_effectisstopped",id) client_cmd(id,"spk voi/voi_heffect2") //u hear the stunning sound } } public he_loudyeffectstop( id ) //stop the LOUDY effect { client_cmd(id,"room_refl 0.92") } public he_effectsfade1( id ) { if(is_user_alive(id)) { client_cmd(id,"room_delay 0.2") // g_fbfx1[id]=1 } else { set_task(0.1,"he_effectisstopped",id) } } public he_effectisstopped( id ) { client_cmd(id,"room_type 0") client_cmd(id,"room_size 0.09") //setting this to default is useless, but u may uncomment it // client_cmd(id,"room_mod 0") client_cmd(id,"room_lp 0") client_cmd(id,"room_left 0.01") g_hefx1[id]=0 //enable the echo g_hefx2[id]=0 //effect g_hefx3[id]=0 //once again } public omgivebeenhe( id ) //you start waking { if(g_heomfg[id]==0) { client_cmd(id,"spk voi/heartbeat_voi") client_cmd(id,"spk voi/breathe_voi") g_heomfg[id]=1 //hmm im stunned, i dont need more set_task(7.0,"hestunn_unblocked",id) //the stunned player sounds are blocked } } public hestunn_unblocked( id ) { g_heomfg[id]=0 //hey i want to be stunned again :) }