Raised This Month: $ Target: $400
 0% 

Slow motion on every 10 killed zombies


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
emoto2
Member
Join Date: May 2016
Old 07-03-2016 , 12:29   Slow motion on every 10 killed zombies
Reply With Quote #1

This plugin add slow motion effect on all players on server when zombie is killed by humans... now when every 1 zombie is killed have this effect.. i want to have this effect on every 10 killed zombies.
Code:
#include <amxmodx> #include <engine> #include <fakemeta> #include <fun> #include <hamsandwich> #include <zombie_plague_special> new const slowmo_start[] = "launcherr/start_slow.wav" new const slowmo_end[] = "launcherr/end_slow.wav" new bool:slow_motion_event new cvar_slowmo_speed, cvar_slowmo_duration, cvar_slowmo_rof new Float:slowmo_speed, Float:slowmo_duration, Float:slowmo_rof, Float:humanspeed new g_iCurWeapon[33], Float:flMaxSpeed[33] new g_bitConnectedPlayers, g_bitAlivePlayers, g_bitZombiePlayers #define MarkUserConnected(%0)   g_bitConnectedPlayers |= (1 << (%0 & 31)) #define ClearUserConnected(%0)  g_bitConnectedPlayers &= ~(1 << (%0 & 31)) #define IsUserConnected(%0) g_bitConnectedPlayers & (1 << (%0 & 31)) #define MarkUserAlive(%0)       g_bitAlivePlayers |= (1 << (%0 & 31)) #define ClearUserAlive(%0)  g_bitAlivePlayers &= ~(1 << (%0 & 31)) #define IsUserAlive(%0)     g_bitAlivePlayers & (1 << (%0 & 31)) #define MarkUserZombie(%0)      g_bitZombiePlayers |= (1 << (%0 & 31)) #define ClearUserZombie(%0) g_bitZombiePlayers &= ~(1 << (%0 & 31)) #define IsUserZombie(%0)    g_bitZombiePlayers & (1 << (%0 & 31)) public plugin_precache() {     precache_sound(slowmo_start)     precache_sound(slowmo_end) } public plugin_init() {     register_plugin("Slow motion","1.4","eXcalibur.007")     register_event("HLTV", "event_new_round", "a", "1=0", "2=0")     register_event("DeathMsg", "event_DeathMsg", "a", "1>0")     register_event("CurWeapon", "event_CurWeapon", "be", "1=1")         RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)         cvar_slowmo_speed = register_cvar("zp_slowmo_speed", "90.0")     cvar_slowmo_duration = register_cvar("zp_slowmo_duration", "2.5")     cvar_slowmo_rof = register_cvar("zp_slowmo_rateoffire", "6.0")         humanspeed = get_cvar_float("zp_human_speed") } public client_putinserver(id) {     MarkUserConnected(id) } public client_disconnect(id) {     ClearUserConnected(id)     ClearUserAlive(id)     ClearUserZombie(id) } public event_new_round() {     slowmo_speed = get_pcvar_float(cvar_slowmo_speed)     slowmo_duration = get_pcvar_float(cvar_slowmo_duration)     slowmo_rof = get_pcvar_float(cvar_slowmo_rof)     humanspeed = get_cvar_float("zp_human_speed")         new iPlayers[32]     new iCount, id     get_players(iPlayers, iCount)             for (new i = 0; i < iCount; i++)     {         id = iPlayers[i]                 ClearUserZombie(id)     } } public event_DeathMsg() {     static killer; killer = read_data(1)     static victim; victim = read_data(2)         ClearUserAlive(victim)         if(zp_get_user_zombie(victim) && !zp_get_user_zombie(killer) && !slow_motion_event)     {         new iPlayers[32]         new iCount, id         get_players(iPlayers, iCount, "ac")                 for (new i = 0; i < iCount; i++)         {             id = iPlayers[i]                         if(IsUserZombie(id))                 flMaxSpeed[id] = get_user_maxspeed(id)         }                 slow_motion_event = true         client_cmd(0, "spk %s", slowmo_start)                 set_task(slowmo_duration, "end_slowmo", 0)     } } public event_CurWeapon(id) {     if(slow_motion_event)     {         g_iCurWeapon[id] = read_data(2)                 if(slowmo_rof > 1.0)         {             static weapon[32], ent             get_weaponname(g_iCurWeapon[id], weapon, 31)             ent = find_ent_by_owner(-1, weapon, id)                         if(ent)             {                 static Float:Delay, Float:M_Delay                 Delay = get_pdata_float(ent, 46, 4) * slowmo_rof                 M_Delay = get_pdata_float(ent, 47, 4) * slowmo_rof                                 if(Delay > 0.0)                 {                     set_pdata_float(ent, 46, Delay, 4)                     set_pdata_float(ent, 47, M_Delay, 4)                 }             }         }     } } public client_PreThink(id) {     if(IsUserAlive(id))     {         if(slow_motion_event)         {             set_user_maxspeed(id, slowmo_speed)         }         else         {             if(IsUserZombie(id))             {                 set_user_maxspeed(id, flMaxSpeed[id])             }             else             {                 if(humanspeed > 0)                     set_user_maxspeed(id, humanspeed)                 else                     cs_reset_user_maxspeed(id)             }         }     } } public fw_PlayerSpawn_Post(id) {     if(is_user_alive(id))         MarkUserAlive(id) } public zp_user_infected_post(id) {     MarkUserZombie(id)         flMaxSpeed[id] = get_user_maxspeed(id) } public zp_user_humanized_post(id) {     ClearUserZombie(id) } public end_slowmo() {     if(slow_motion_event)     {         slow_motion_event = false         client_cmd(0, "spk %s", slowmo_end)     } } stock cs_reset_user_maxspeed(id) {     new Float:flMaxSpeed     switch(g_iCurWeapon[id])     {         case CSW_SG550, CSW_AWP, CSW_G3SG1 : flMaxSpeed = 210.0         case CSW_M249 : flMaxSpeed = 220.0         case CSW_AK47 : flMaxSpeed = 221.0         case CSW_M3, CSW_M4A1 : flMaxSpeed = 230.0         case CSW_SG552 : flMaxSpeed = 235.0         case CSW_XM1014, CSW_AUG, CSW_GALIL, CSW_FAMAS : flMaxSpeed = 240.0         case CSW_P90 : flMaxSpeed = 245.0         case CSW_SCOUT : flMaxSpeed = 260.0         default : flMaxSpeed = 250.0     }     set_user_maxspeed(id, flMaxSpeed) }
emoto2 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode