Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <dhudmessage>
- #include <zombieplague>
- new const g_light_levels[][] = { "", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m","n" }
- new const g_countdown_sounds[][] =
- {
- "",
- "DyingLight/battle_begins.wav",
- "",
- "",
- "",
- "DyingLight/5secremain.wav",
- "",
- "",
- "",
- "",
- "DyingLight/10secremain.wav",
- "",
- "",
- "DyingLight/start5.wav",
- "",
- "DyingLight/prepare.wav",
- "",
- "",
- "",
- "",
- "DyingLight/reserve.wav",
- "",
- "",
- "",
- "", "", "", "", "", "",
- "DyingLight/30secremain.wav",
- "", "",
- "DyingLight/sirena.wav"
- }
- const g_light_levels_size = sizeof g_light_levels - 1
- const g_countdown_sounds_size = sizeof g_countdown_sounds
- new g_delay, g_seconds, g_lighting[2], cvar_effects
- public plugin_init()
- {
- register_plugin("[ZPNM] Countdown Light", "1.3", "D i 5 7 i n c T")
- register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
- register_dictionary("DyingLight_countdown.txt")
- cvar_effects = register_cvar("zpnm_countdown_effects", "1")
- }
- public plugin_precache()
- {
- static i;
- for (i = 0; i < g_countdown_sounds_size; i++)
- if (g_countdown_sounds[i][0])
- engfunc(EngFunc_PrecacheSound, g_countdown_sounds[i])
- }
- public plugin_cfg()
- set_task(1.57, "cache_settings", 757)
- public cache_settings()
- {
- g_delay = get_cvar_num("zp_delay")
- get_cvar_string("zp_lighting", g_lighting, 1)
- }
- // Event Round Start
- public event_round_start()
- {
- if (!g_delay)
- return;
- remove_task(57)
- remove_task(75)
- remove_task(577)
- if (get_pcvar_num(cvar_effects))
- {
- g_seconds = 10
- ThunderClap1(75)
- set_cvar_string("zp_lighting", "0")
- }
- else
- {
- g_seconds = g_delay
- set_task(1.0, "CountDown", 57)
- }
- }
- public ThunderClap1(taskid)
- {
- if (g_seconds)
- {
- if (g_seconds % 2 == 0)
- engfunc(EngFunc_LightStyle, 0, "c")
- else
- engfunc(EngFunc_LightStyle, 0, "b")
- g_seconds--
- set_task(0.1, "ThunderClap1", taskid)
- }
- else
- {
- if (g_delay > g_light_levels_size)
- engfunc(EngFunc_LightStyle, 0, g_light_levels[g_light_levels_size])
- else
- engfunc(EngFunc_LightStyle, 0, g_light_levels[g_delay])
- g_seconds = g_delay
- CountDown(57)
- }
- }
- public CountDown(taskid)
- {
- // Check for the external "TASK_MAKEZOMBIE" from inside ZPNM
- if (!task_exists(3000, 1)) //2010
- return;
- set_dhudmessage(random_num(57, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.1000, 2, 1.1, 1.1, 0.0, 0.0)
- show_dhudmessage(0, "%L", LANG_PLAYER, "TALRASHA_COUNTDOWN", g_seconds)
- if (get_pcvar_num(cvar_effects) && g_seconds <= g_light_levels_size)
- engfunc(EngFunc_LightStyle, 0, g_light_levels[g_seconds])
- if (g_seconds < g_countdown_sounds_size && g_countdown_sounds[g_seconds][0])
- client_cmd(0, "spk %s", g_countdown_sounds[g_seconds])
- g_seconds--
- if (g_seconds)
- set_task(1.0, "CountDown", taskid)
- }
- public ThunderClap2(taskid)
- {
- if (g_seconds)
- {
- if (g_seconds % 2 != 0)
- engfunc(EngFunc_LightStyle, 0, "z")
- else
- engfunc(EngFunc_LightStyle, 0, "b")
- g_seconds--
- set_task(0.1, "ThunderClap2", taskid)
- }
- else
- {
- engfunc(EngFunc_LightStyle, 0, g_lighting)
- set_cvar_string("zp_lighting", g_lighting)
- }
- }
- public zp_round_started(mode, id)
- {
- remove_task(57)
- remove_task(75)
- remove_task(577)
- client_cmd(0, "spk %s", g_countdown_sounds[0])
- if (!get_pcvar_num(cvar_effects))//|| mode == MODE_ASSASSIN)
- return;
- g_seconds = 15
- ThunderClap2(577)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement