Midnight's Darkness
Midnight's Darkness
I'm just asking! will it be useful + fun in our mod?
Since zombies have nightvision they can hunt more at night humans have to survive the night.
A round will be night round (random round) Round set by cvars. lighting system can be linked with ze.cfg with the plugin i guess.
original plugin link : https://forums.alliedmods.net/showthread.php?t=212740.
In my opinion we must give it a try
~i'm just a noob
Since zombies have nightvision they can hunt more at night humans have to survive the night.
A round will be night round (random round) Round set by cvars. lighting system can be linked with ze.cfg with the plugin i guess.
original plugin link : https://forums.alliedmods.net/showthread.php?t=212740.
In my opinion we must give it a try
~i'm just a noob
LOL
Hmm, I do something like: I try to detect how many number of rounds will be in one map by dividing maptime/roundtime this give me min rounds can be played. Then i get random number between 0 round and this number i get. The random round will be darkness and it's only 1 round per map.
Or better idea is to get map time and get random number between 0 - maptime and then start darkness for a period that we define by cvar? I don't know but this what i did:
Or better idea is to get map time and get random number between 0 - maptime and then start darkness for a period that we define by cvar? I don't know but this what i did:
He who fails to plan is planning to fail
Raheem it's not random it starts in the first round itself! But i want it to start at random rounds .or if it cant be random can we set the exact rounds which night mode will start by
making g_iRoundNum = 0 to any numbers?
If yes i tried it at 3 but night mode never started!
making g_iRoundNum = 0 to any numbers?
If yes i tried it at 3 but night mode never started!
LOL
Try something like:
g_iRandomRoundNum = random_num(0, 10)
But if in your server in one map you don't play 10 rounds so it won't be appear the darkness round.He who fails to plan is planning to fail
I edit this to remove Fog if you have fog on. It will become total backout!
- #include <zombie_escape>
- #define DARKSOUND "dark/darkness.wav"
- #define DEFAULT_LIGHT "d"
- new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
- public plugin_init()
- {
- register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
- // Pointers
- g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
- g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
- // Check rounds number
- new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
- // Get random round
- g_iRandomRoundNum = random_num(0, iRoundsNumber)
- // Set counter to 0 first round
- g_iRoundNum = 0
- // Dark round false
- g_bDarkRoundCome = false
- }
- public plugin_precache()
- {
- precache_sound(DARKSOUND)
- }
- public ze_game_started()
- {
- if (g_iRoundNum == g_iRandomRoundNum)
- {
- for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
- {
- if (!is_user_connected(id))
- continue
- PlaySound(id, DARKSOUND)
- }
- server_cmd("ze_lighting_style a")
- client_cmd(0, "gl_fog 0")
- g_bDarkRoundCome = true
- ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
- }
- g_iRoundNum++
- }
- public ze_roundend(WinTeam)
- {
- if (g_bDarkRoundCome == true)
- {
- server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
- client_cmd(0, "gl_fog 1")
- g_bDarkRoundCome = false
- }
- }
Can you add this to addons so its not hard to find lolRaheem wrote: ↑6 years ago Hmm, I do something like: I try to detect how many number of rounds will be in one map by dividing maptime/roundtime this give me min rounds can be played. Then i get random number between 0 round and this number i get. The random round will be darkness and it's only 1 round per map.
Or better idea is to get map time and get random number between 0 - maptime and then start darkness for a period that we define by cvar? I don't know but this what i did:Don't forget to change default light from code.
- Darness Round.zip
For better slow hacking:Mark wrote: ↑5 years agoI edit this to remove Fog if you have fog on. It will become total backout!
#include <zombie_escape> #define DARKSOUND "dark/darkness.wav" #define DEFAULT_LIGHT "d" new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome public plugin_init() { register_plugin("[ZE] Darkness Round", "1.0", "Raheem") // Pointers g_pCvarRoundTime = get_cvar_pointer("mp_roundtime") g_pCvarMapTime = get_cvar_pointer("mp_timelimit") // Check rounds number new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime) // Get random round g_iRandomRoundNum = random_num(0, iRoundsNumber) // Set counter to 0 first round g_iRoundNum = 0 // Dark round false g_bDarkRoundCome = false } public plugin_precache() { precache_sound(DARKSOUND) } public ze_game_started() { if (g_iRoundNum == g_iRandomRoundNum) { for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++) { if (!is_user_connected(id)) continue PlaySound(id, DARKSOUND) } server_cmd("ze_lighting_style a") client_cmd(0, "gl_fog 0") g_bDarkRoundCome = true ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!") } g_iRoundNum++ } public ze_roundend(WinTeam) { if (g_bDarkRoundCome == true) { server_cmd("ze_lighting_style %s", DEFAULT_LIGHT) client_cmd(0, "gl_fog 1") g_bDarkRoundCome = false } }
- #include <zombie_escape>
- #define DARKSOUND "dark/darkness.wav"
- #define DEFAULT_LIGHT "d"
- new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
- public plugin_init()
- {
- register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
- // Pointers
- g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
- g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
- // Check rounds number
- new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
- // Get random round
- g_iRandomRoundNum = random_num(0, iRoundsNumber)
- // Set counter to 0 first round
- g_iRoundNum = 0
- // Dark round false
- g_bDarkRoundCome = false
- }
- public plugin_precache()
- {
- precache_sound(DARKSOUND)
- }
- public ze_game_started()
- {
- if (g_iRoundNum == g_iRandomRoundNum)
- {
- for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
- {
- if (!is_user_connected(id))
- continue
- PlaySound(id, DARKSOUND)
- }
- server_cmd("ze_lighting_style a")
- client_cmd(0, "gl_fog 0")
- g_bDarkRoundCome = true
- ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
- }
- g_iRoundNum++
- }
- public ze_roundend(WinTeam)
- {
- if (g_bDarkRoundCome == true)
- {
- server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
- Send_Cmd(0, "gl_fog 1")
- g_bDarkRoundCome = false
- }
- }
- stock Send_Cmd(id, text[])
- {
- message_begin(MSG_ONE, 51, _, id)
- write_byte(strlen(text) + 2)
- write_byte(10)
- write_string(text)
- message_end()
- }
He who fails to plan is planning to fail
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 4 guests