Approved Darkness Round

Gameplay Addons
Post Reply
User avatar
Mark
Senior Member
Senior Member
United States of America
Posts: 279
Joined: 10 Months Ago
Location: Des Moines/USA
Donation: 1x donated in total €10.00
Has thanked: 6 times
Been thanked: 21 times
Age: 33
Contact:

Darkness Round

#1

Post by Mark » 9 Months Ago

Darkness Round

Description:
  • This will set dark rounds randomly as the new round starts
  • It will also remove the fog while in this round

Credits:
  • Rain1153 = His Idea

Code:
    1. #include <zombie_escape>
    2.  
    3. #define DARKSOUND "dark/darkness.wav"
    4. #define DEFAULT_LIGHT "d"
    5.  
    6. new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
    7.  
    8. public plugin_init()
    9. {
    10.     register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
    11.    
    12.     // Pointers
    13.     g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
    14.     g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
    15.    
    16.     // Check rounds number
    17.     new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
    18.    
    19.     // Get random round
    20.     g_iRandomRoundNum = random_num(0, iRoundsNumber)
    21.    
    22.     // Set counter to 0 first round
    23.     g_iRoundNum = 0
    24.    
    25.     // Dark round false
    26.     g_bDarkRoundCome = false
    27. }
    28.  
    29. public plugin_precache()
    30. {
    31.     precache_sound(DARKSOUND)
    32. }
    33.  
    34. public ze_game_started()
    35. {
    36.     if (g_iRoundNum == g_iRandomRoundNum)
    37.     {
    38.         for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
    39.         {
    40.             if (!is_user_connected(id))
    41.                 continue
    42.            
    43.             PlaySound(id, DARKSOUND)
    44.         }
    45.  
    46.         server_cmd("ze_lighting_style a")
    47.         client_cmd(0, "gl_fog 0")
    48.         g_bDarkRoundCome = true
    49.         ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
    50.     }
    51.    
    52.     g_iRoundNum++
    53. }
    54.  
    55. public ze_roundend(WinTeam)
    56. {
    57.     if (g_bDarkRoundCome == true)
    58.     {
    59.         server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
    60.         Send_Cmd(0, "gl_fog 1")
    61.         g_bDarkRoundCome = false
    62.     }
    63. }
    64.  
    65. stock Send_Cmd(id, text[])
    66. {
    67.     message_begin(MSG_ONE, 51, _, id)
    68.     write_byte(strlen(text) + 2)
    69.     write_byte(10)
    70.     write_string(text)
    71.     message_end()
    72. }
If your want fog to be off use this code:

    1. #include <zombie_escape>
    2.  
    3. #define DARKSOUND "dark/darkness.wav"
    4. #define DEFAULT_LIGHT "d"
    5.  
    6. new g_pCvarRoundTime, g_pCvarMapTime, g_iRandomRoundNum, g_iRoundNum, bool:g_bDarkRoundCome
    7.  
    8. public plugin_init()
    9. {
    10.     register_plugin("[ZE] Darkness Round", "1.0", "Raheem")
    11.    
    12.     // Pointers
    13.     g_pCvarRoundTime = get_cvar_pointer("mp_roundtime")
    14.     g_pCvarMapTime = get_cvar_pointer("mp_timelimit")
    15.    
    16.     // Check rounds number
    17.     new iRoundsNumber = get_pcvar_num(g_pCvarMapTime) / get_pcvar_num(g_pCvarRoundTime)
    18.    
    19.     // Get random round
    20.     g_iRandomRoundNum = random_num(0, iRoundsNumber)
    21.    
    22.     // Set counter to 0 first round
    23.     g_iRoundNum = 0
    24.    
    25.     // Dark round false
    26.     g_bDarkRoundCome = false
    27. }
    28.  
    29. public plugin_precache()
    30. {
    31.     precache_sound(DARKSOUND)
    32. }
    33.  
    34. public ze_game_started()
    35. {
    36.     if (g_iRoundNum == g_iRandomRoundNum)
    37.     {
    38.         for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
    39.         {
    40.             if (!is_user_connected(id))
    41.                 continue
    42.            
    43.             PlaySound(id, DARKSOUND)
    44.         }
    45.  
    46.         server_cmd("ze_lighting_style a")
    47.         g_bDarkRoundCome = true
    48.         ze_colored_print(0, "!tIt's too late... Darkness round is ON!y!")
    49.     }
    50.    
    51.     g_iRoundNum++
    52. }
    53.  
    54. public ze_roundend(WinTeam)
    55. {
    56.     if (g_bDarkRoundCome == true)
    57.     {
    58.         server_cmd("ze_lighting_style %s", DEFAULT_LIGHT)
    59.         g_bDarkRoundCome = false
    60.     }
    61. }
    62.  
    63. stock Send_Cmd(id, text[])
    64. {
    65.     message_begin(MSG_ONE, 51, _, id)
    66.     write_byte(strlen(text) + 2)
    67.     write_byte(10)
    68.     write_string(text)
    69.     message_end()
    70. }

Download:

Darkness Round.zip
(688.84 KiB) Downloaded 40 times
Darkness Round.zip
(688.84 KiB) Downloaded 40 times
These users thanked the author Mark for the post:
Raheem (9 Months Ago)

User avatar
Muhammet20
Senior Member
Senior Member
Turkey
Posts: 128
Joined: 9 Months Ago
Has thanked: 14 times
Been thanked: 1 time
Contact:

#2

Post by Muhammet20 » 5 Months Ago

what is this can do ?
Don't Say This Is Impossible , Because Nothing Impossible.

Rain1153
Senior Member
Senior Member
India
Posts: 277
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#3

Post by Rain1153 » 5 Months Ago

Read the description
LOL

User avatar
Muhammet20
Senior Member
Senior Member
Turkey
Posts: 128
Joined: 9 Months Ago
Has thanked: 14 times
Been thanked: 1 time
Contact:

#4

Post by Muhammet20 » 4 Months Ago

Rain1153 wrote:
5 Months Ago
Read the description
good idea but i dont need it :)
Don't Say This Is Impossible , Because Nothing Impossible.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest