Remove Freeze Time, Make all humans run together + Respawn

Helping Topics
User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1998
Joined: 3 Years Ago
Location: Egypt
Has thanked: 33 times
Been thanked: 111 times
Age: 22
Contact:

Remove Freeze Time, Make all humans run together + Respawn

#1

Post by Raheem » 7 Months Ago

Hello,

In this topic, you will learn how to remove freeze time and make all players run together and when the countdown ends and zombies chosen they will be respawned.

*** This works for version >= 1.3 ***

First you will need to open ze_core.sma and find:
    1.     // Loop till we find req players
    2.     while(iZombies < iReqZombies)
    3.     {
    4.         id = GetRandomAlive(random_num(1, iAliveCount))
    5.        
    6.         if (!is_user_alive(id) || g_bIsZombie[id])
    7.             continue
    8.        
    9.         if (get_pcvar_num(g_pCvarSmartRandom))
    10.         {
    11.             // If player in the array, it means he chosen previous round so skip him this round
    12.             if (IsPlayerInArray(g_aChosenPlayers, id))
    13.                 continue
    14.         }
    15.  
    16.         Set_User_Zombie(id)
    17.         set_entvar(id, var_health, get_pcvar_float(g_pCvarFirstZombiesHealth))
    18.         g_bIsZombieFrozen[id] = true
    19.         g_bZombieFreezeTime = true
    20.         set_entvar(id, var_maxspeed, 1.0)
    21.         set_task(0.1, "Freeze_Zombies", FREEZE_ZOMBIES, _, _, "b") // Better than PreThink
    22.         ExecuteForward(g_iForwards[FORWARD_ZOMBIE_APPEAR], g_iFwReturn)
    23.         iZombies++
    24.     }
And just add rg_round_respawn(id) so it's:
    1.     // Loop till we find req players
    2.     while(iZombies < iReqZombies)
    3.     {
    4.         id = GetRandomAlive(random_num(1, iAliveCount))
    5.        
    6.         if (!is_user_alive(id) || g_bIsZombie[id])
    7.             continue
    8.        
    9.         if (get_pcvar_num(g_pCvarSmartRandom))
    10.         {
    11.             // If player in the array, it means he chosen previous round so skip him this round
    12.             if (IsPlayerInArray(g_aChosenPlayers, id))
    13.                 continue
    14.         }
    15.  
    16.         Set_User_Zombie(id)
    17.         set_entvar(id, var_health, get_pcvar_float(g_pCvarFirstZombiesHealth))
    18.         g_bIsZombieFrozen[id] = true
    19.         g_bZombieFreezeTime = true
    20.         set_entvar(id, var_maxspeed, 1.0)
    21.         set_task(0.1, "Freeze_Zombies", FREEZE_ZOMBIES, _, _, "b") // Better than PreThink
    22.         ExecuteForward(g_iForwards[FORWARD_ZOMBIE_APPEAR], g_iFwReturn)
    23.         iZombies++
    24.        
    25.         // Respawn Zombies to base
    26.         rg_round_respawn(id)
    27.     }
Find:
    1.     if (g_bGameStarted)
    2.     {
    3.         if (g_iRoundNum == 1)
    4.         {
    5.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    6.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 2
    7.         }
    8.         else
    9.         {
    10.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    11.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 3
    12.         }
    13.     }
And to edit it to:
    1.     if (g_bGameStarted)
    2.     {
    3.         if (g_iRoundNum == 1)
    4.         {
    5.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    6.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 2
    7.         }
    8.         else
    9.         {
    10.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    11.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 3
    12.         }
    13.     }
Find: Edit it to: Find:
    1. // Variables
    2. new g_iAliveHumansNum,
    3.     g_iAliveZombiesNum,
    4.     g_iRoundTime,
    5.     g_iCountDown,
    6.     g_iReleaseNotice,
    7.     g_iMaxClients,
    8.     g_iHumansScore,
    9.     g_iZombiesScore,
    10.     g_iRoundNum,
    11.     g_iHSpeedFactor[33],
    12.     g_iZSpeedSet[33],
    13.     g_iUserGravity[33],
    14.     bool:g_bGameStarted,
    15.     bool:g_bIsZombie[33],
    16.     bool:g_bIsZombieFrozen[33],
    17.     bool:g_bZombieFreezeTime,
    18.     bool:g_bIsRoundEnding,
    19.     bool:g_bHSpeedUsed[33],
    20.     bool:g_bZSpeedUsed[33],
    21.     bool:g_bEndCalled,
    22.     bool:g_bIsKnockBackUsed[33],
    23.     bool:g_bIsGravityUsed[33],
    24.     bool:g_bEnteredNotChoosed[33],
    25.     Float:g_flReferenceTime,
    26.     Float:g_flUserKnockback[33],
Edit to (only added Float:g_flReferenceTime2):
    1. // Variables
    2. new g_iAliveHumansNum,
    3.     g_iAliveZombiesNum,
    4.     g_iRoundTime,
    5.     g_iCountDown,
    6.     g_iReleaseNotice,
    7.     g_iMaxClients,
    8.     g_iHumansScore,
    9.     g_iZombiesScore,
    10.     g_iRoundNum,
    11.     g_iHSpeedFactor[33],
    12.     g_iZSpeedSet[33],
    13.     g_iUserGravity[33],
    14.     bool:g_bGameStarted,
    15.     bool:g_bIsZombie[33],
    16.     bool:g_bIsZombieFrozen[33],
    17.     bool:g_bZombieFreezeTime,
    18.     bool:g_bIsRoundEnding,
    19.     bool:g_bHSpeedUsed[33],
    20.     bool:g_bZSpeedUsed[33],
    21.     bool:g_bEndCalled,
    22.     bool:g_bIsKnockBackUsed[33],
    23.     bool:g_bIsGravityUsed[33],
    24.     bool:g_bEnteredNotChoosed[33],
    25.     Float:g_flReferenceTime,
    26.     Float:g_flUserKnockback[33],
    27.     Float:g_flReferenceTime2
Find:
    1. public Fw_PlayerSpawn_Post(id)
    2. {  
    3.     if (!g_bGameStarted)
    4.     {
    5.         // Force All player to be Humans if Game not started yet
    6.         rg_set_user_team(id, TEAM_CT, MODEL_UNASSIGNED)
    7.     }
    8.     else
    9.     {
    10.         if (get_member_game(m_bFreezePeriod))
    11.         {
    12.             // Respawn Him As human if we are in freeze time (Zombie Not Chosen yet)
    13.             Set_User_Human(id)
    14.             g_bIsZombieFrozen[id] = false
    15.         }
    16.         else
    17.         {
    18.             if (g_bZombieFreezeTime)
    19.             {
    20.                 // Zombie Chosen and zombies Frozen, Spawn him as zombie and Freeze Him
    21.                 Set_User_Zombie(id)
    22.                 g_bIsZombieFrozen[id] = true
    23.                 set_entvar(id, var_maxspeed, 1.0)
    24.             }
    25.             else
    26.             {
    27.                 // Respawn him as normal zombie
    28.                 Set_User_Zombie(id)
    29.                 g_bIsZombieFrozen[id] = false
    30.             }
    31.         }
    32.     }
    33. }
Edit it to:
    1. public Fw_PlayerSpawn_Post(id)
    2. {  
    3.     if (!g_bGameStarted)
    4.     {
    5.         // Force All player to be Humans if Game not started yet
    6.         rg_set_user_team(id, TEAM_CT, MODEL_UNASSIGNED)
    7.     }
    8.     else
    9.     {
    10.         if ((floatround(g_flReferenceTime2)+get_pcvar_num(g_pCvarFreezeTime)) > floatround(get_gametime())+2)
    11.         {
    12.             // Respawn Him As human if we are in freeze time (Zombie Not Chosen yet)
    13.             Set_User_Human(id)
    14.             g_bIsZombieFrozen[id] = false
    15.         }
    16.         else
    17.         {
    18.             if (g_bZombieFreezeTime)
    19.             {
    20.                 // Zombie Chosen and zombies Frozen, Spawn him as zombie and Freeze Him
    21.                 Set_User_Zombie(id)
    22.                 g_bIsZombieFrozen[id] = true
    23.                 set_entvar(id, var_maxspeed, 1.0)
    24.             }
    25.             else
    26.             {
    27.                 // Respawn him as normal zombie
    28.                 Set_User_Zombie(id)
    29.                 g_bIsZombieFrozen[id] = false
    30.             }
    31.         }
    32.     }
    33. }
Finally Edit:
    1. public New_Round()
    2. {
    3.     if (g_bGameStarted)
    4.     {
    5.         g_iRoundNum++
    6.     }
    7.    
    8.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED_PRE], g_iFwReturn)
    9.    
    10.     if (g_iFwReturn > 0)
    11.     {
    12.         return
    13.     }
    14.    
    15.     // Remove All tasks in the New Round
    16.     remove_task(TASK_COUNTDOWN)
    17.     remove_task(TASK_COUNTDOWN2)
    18.     remove_task(TASK_SCORE_MESSAGE)
    19.     remove_task(FREEZE_ZOMBIES)
    20.    
    21.     // Score Message Task
    22.     set_task(10.0, "Score_Message", TASK_SCORE_MESSAGE, _, _, "b")
    23.    
    24.     if (g_bGameStarted)
    25.     {
    26.         if (g_iRoundNum == 1)
    27.         {
    28.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    29.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 2
    30.         }
    31.         else
    32.         {
    33.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    34.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 3
    35.         }
    36.     }
    37.    
    38.     if (!g_bGameStarted)
    39.     {
    40.         // No Enough Players
    41.         ze_colored_print(0, "%L", LANG_PLAYER, "NO_ENOUGH_PLAYERS", get_pcvar_num(g_pCvarReqPlayers))
    42.         return // Block the execution of the blew code
    43.     }
    44.    
    45.     // Game Already started, Countdown now started
    46.     set_task(1.0, "Countdown_Start", TASK_COUNTDOWN, _, _, "b")
    47.     ze_colored_print(0, "%L", LANG_PLAYER, "READY_TO_RUN")
    48.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED], g_iFwReturn)
    49.    
    50.     // Round Starting
    51.     g_bIsRoundEnding = false
    52.     g_bEndCalled = false
    53. }
TO (Only added: g_flReferenceTime2 = get_gametime()):
    1. public New_Round()
    2. {
    3.     g_flReferenceTime2 = get_gametime()
    4.    
    5.     if (g_bGameStarted)
    6.     {
    7.         g_iRoundNum++
    8.     }
    9.    
    10.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED_PRE], g_iFwReturn)
    11.    
    12.     if (g_iFwReturn > 0)
    13.     {
    14.         return
    15.     }
    16.    
    17.     // Remove All tasks in the New Round
    18.     remove_task(TASK_COUNTDOWN)
    19.     remove_task(TASK_COUNTDOWN2)
    20.     remove_task(TASK_SCORE_MESSAGE)
    21.     remove_task(FREEZE_ZOMBIES)
    22.    
    23.     // Score Message Task
    24.     set_task(10.0, "Score_Message", TASK_SCORE_MESSAGE, _, _, "b")
    25.    
    26.     if (g_bGameStarted)
    27.     {
    28.         if (g_iRoundNum == 1)
    29.         {
    30.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    31.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 2
    32.         }
    33.         else
    34.         {
    35.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    36.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 3
    37.         }
    38.     }
    39.    
    40.     if (!g_bGameStarted)
    41.     {
    42.         // No Enough Players
    43.         ze_colored_print(0, "%L", LANG_PLAYER, "NO_ENOUGH_PLAYERS", get_pcvar_num(g_pCvarReqPlayers))
    44.         return // Block the execution of the blew code
    45.     }
    46.    
    47.     // Game Already started, Countdown now started
    48.     set_task(1.0, "Countdown_Start", TASK_COUNTDOWN, _, _, "b")
    49.     ze_colored_print(0, "%L", LANG_PLAYER, "READY_TO_RUN")
    50.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED], g_iFwReturn)
    51.    
    52.     // Round Starting
    53.     g_bIsRoundEnding = false
    54.     g_bEndCalled = false
    55. }
Now finally you will need to open zombie_escape.cfg and find mp_freezetime and make it zero. And find ze_freeze_time and make it any value, for example: ze_freeze_time 20. Also open server.cfg and make sure that mp_freezetime is set to zero.

That's it and Have fun, by the way, I hate this idea but made it as TUT because it came in the ideas of our new mod version: #14

Fixing restarting when player disconnect during countdown:

Firstly we change:
    1. // Tasks IDs
    2. enum
    3. {
    4.     TASK_COUNTDOWN = 1100,
    5.     TASK_COUNTDOWN2,
    6.     TASK_SCORE_MESSAGE,
    7.     FREEZE_ZOMBIES,
    8.     ROUND_TIME_LEFT
    9. }
TO:
    1. // Tasks IDs
    2. enum
    3. {
    4.     TASK_COUNTDOWN = 1100,
    5.     TASK_COUNTDOWN2,
    6.     TASK_SCORE_MESSAGE,
    7.     FREEZE_ZOMBIES,
    8.     ROUND_TIME_LEFT,
    9.     CHOOSED_TASK_ID
    10. }
Second you define this variable: bool:g_bZombieChosen, so variables now:
    1. // Variables
    2. new g_iAliveHumansNum,
    3.     g_iAliveZombiesNum,
    4.     g_iRoundTime,
    5.     g_iCountDown,
    6.     g_iReleaseNotice,
    7.     g_iMaxClients,
    8.     g_iHumansScore,
    9.     g_iZombiesScore,
    10.     g_iRoundNum,
    11.     g_iHSpeedFactor[33],
    12.     g_iZSpeedSet[33],
    13.     g_iUserGravity[33],
    14.     bool:g_bGameStarted,
    15.     bool:g_bIsZombie[33],
    16.     bool:g_bIsZombieFrozen[33],
    17.     bool:g_bZombieFreezeTime,
    18.     bool:g_bIsRoundEnding,
    19.     bool:g_bHSpeedUsed[33],
    20.     bool:g_bZSpeedUsed[33],
    21.     bool:g_bEndCalled,
    22.     bool:g_bIsKnockBackUsed[33],
    23.     bool:g_bIsGravityUsed[33],
    24.     bool:g_bEnteredNotChoosed[33],
    25.     Float:g_flReferenceTime,
    26.     Float:g_flUserKnockback[33],
    27.     Float:g_flReferenceTime2,
    28.     bool:g_bZombieChosen
Thrid we find public New_Round(), and edit it to be like:
    1. public New_Round()
    2. {
    3.         g_flReferenceTime2 = get_gametime()
    4.  
    5.     if (g_bGameStarted)
    6.     {
    7.         g_iRoundNum++
    8.     }
    9.    
    10.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED_PRE], g_iFwReturn)
    11.    
    12.     if (g_iFwReturn > 0)
    13.     {
    14.         return
    15.     }
    16.    
    17.     // Remove All tasks in the New Round
    18.     remove_task(TASK_COUNTDOWN)
    19.     remove_task(TASK_COUNTDOWN2)
    20.     remove_task(TASK_SCORE_MESSAGE)
    21.     remove_task(FREEZE_ZOMBIES)
    22.     remove_task(CHOOSED_TASK_ID)
    23.    
    24.     // Score Message Task
    25.     set_task(10.0, "Score_Message", TASK_SCORE_MESSAGE, _, _, "b")
    26.    
    27.     if (g_bGameStarted)
    28.     {
    29.         if (g_iRoundNum == 1)
    30.         {
    31.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    32.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 2
    33.         }
    34.         else
    35.         {
    36.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    37.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 3
    38.         }
    39.     }
    40.    
    41.     if (!g_bGameStarted)
    42.     {
    43.         // No Enough Players
    44.         ze_colored_print(0, "%L", LANG_PLAYER, "NO_ENOUGH_PLAYERS", get_pcvar_num(g_pCvarReqPlayers))
    45.         return // Block the execution of the blew code
    46.     }
    47.    
    48.     // Game Already started, Countdown now started
    49.     set_task(1.0, "Countdown_Start", TASK_COUNTDOWN, _, _, "b")
    50.     ze_colored_print(0, "%L", LANG_PLAYER, "READY_TO_RUN")
    51.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED], g_iFwReturn)
    52.    
    53.     // Round Starting
    54.     g_bIsRoundEnding = false
    55.     g_bEndCalled = false
    56.     g_bZombieChosen = false
    57.    
    58.     set_task(get_pcvar_float(g_pCvarFreezeTime)+1.0, "Choosed", CHOOSED_TASK_ID)
    59. }
What added is only these three lines:
    1. remove_task(CHOOSED_TASK_ID)
    2. g_bZombieChosen = false
    3. set_task(get_pcvar_float(g_pCvarFreezeTime)+1.0, "Choosed", CHOOSED_TASK_ID)
Now add this function (Task function): Finally you need to change:
    1.             // Humans number more than 1 and no zombies?
    2.             if (g_iAliveHumansNum >= get_pcvar_num(g_pCvarReqPlayers) && g_iAliveZombiesNum == 0 && !g_bIsRoundEnding)
    3.             {
    4.                 // Then Escape success as there is no Zombies
    5.                 rg_round_end(get_pcvar_float(g_pCvarRoundEndDelay), WINSTATUS_CTS, ROUND_CTS_WIN, "")
    6.                 client_print(0, print_center, "%L", LANG_PLAYER, "ESCAPE_SUCCESS")
    7.             }
To:
    1.             // Humans number more than 1 and no zombies?
    2.             if (g_iAliveHumansNum >= get_pcvar_num(g_pCvarReqPlayers) && g_iAliveZombiesNum == 0 && !g_bIsRoundEnding && g_bZombieChosen)
    3.             {
    4.                 // Then Escape success as there is no Zombies
    5.                 rg_round_end(get_pcvar_float(g_pCvarRoundEndDelay), WINSTATUS_CTS, ROUND_CTS_WIN, "")
    6.                 client_print(0, print_center, "%L", LANG_PLAYER, "ESCAPE_SUCCESS")
    7.             }
Fixed full source here: viewtopic.php?p=10938#p10938

Fell free to report any bug you find.
Last edited by Raheem on 28 Jan 2020, 14:12, edited 2 times in total.
Reason: Fixed round restarting.
Loading Raheem's signature, Please wait...
Image

Mystic Viper
Senior Member
Senior Member
Romania
Posts: 114
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

#2

Post by Mystic Viper » 7 Months Ago

There is a bug in this

When the round begin is showing on chat a number randomly like this: 11406932

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1998
Joined: 3 Years Ago
Location: Egypt
Has thanked: 33 times
Been thanked: 111 times
Age: 22
Contact:

#3

Post by Raheem » 7 Months Ago

Mystic Viper wrote:
7 Months Ago
There is a bug in this

When the round begin is showing on chat a number randomly like this: 11406932
Remove this line:
    1. client_print(0, print_chat, "%i", g_flReferenceTime2+get_pcvar_num(g_pCvarFreezeTime))
Loading Raheem's signature, Please wait...
Image

Mystic Viper
Senior Member
Senior Member
Romania
Posts: 114
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

#4

Post by Mystic Viper » 7 Months Ago

That line not exist in core

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1998
Joined: 3 Years Ago
Location: Egypt
Has thanked: 33 times
Been thanked: 111 times
Age: 22
Contact:

#5

Post by Raheem » 7 Months Ago

Because i removed it, you won't face this issue again.
Loading Raheem's signature, Please wait...
Image

karan
Mod Tester
Mod Tester
India
Posts: 89
Joined: 2 Years Ago
Location: India
Has thanked: 2 times
Been thanked: 5 times
Age: 22
Contact:

#6

Post by karan » 3 Months Ago

Raheem wrote:
7 Months Ago
Hello,

In this topic you will learn how to remove freeze time, and make all players run together and when the countdown ends and zombies chosen they will be respawned.

*** This works for version >= 1.3 ***

First you will need to open ze_core.sma and find:
    1.     // Loop till we find req players
    2.     while(iZombies < iReqZombies)
    3.     {
    4.         id = GetRandomAlive(random_num(1, iAliveCount))
    5.        
    6.         if (!is_user_alive(id) || g_bIsZombie[id])
    7.             continue
    8.        
    9.         if (get_pcvar_num(g_pCvarSmartRandom))
    10.         {
    11.             // If player in the array, it means he chosen previous round so skip him this round
    12.             if (IsPlayerInArray(g_aChosenPlayers, id))
    13.                 continue
    14.         }
    15.  
    16.         Set_User_Zombie(id)
    17.         set_entvar(id, var_health, get_pcvar_float(g_pCvarFirstZombiesHealth))
    18.         g_bIsZombieFrozen[id] = true
    19.         g_bZombieFreezeTime = true
    20.         set_entvar(id, var_maxspeed, 1.0)
    21.         set_task(0.1, "Freeze_Zombies", FREEZE_ZOMBIES, _, _, "b") // Better than PreThink
    22.         ExecuteForward(g_iForwards[FORWARD_ZOMBIE_APPEAR], g_iFwReturn)
    23.         iZombies++
    24.     }
And just add rg_round_respawn(id) so it's:
    1.     // Loop till we find req players
    2.     while(iZombies < iReqZombies)
    3.     {
    4.         id = GetRandomAlive(random_num(1, iAliveCount))
    5.        
    6.         if (!is_user_alive(id) || g_bIsZombie[id])
    7.             continue
    8.        
    9.         if (get_pcvar_num(g_pCvarSmartRandom))
    10.         {
    11.             // If player in the array, it means he chosen previous round so skip him this round
    12.             if (IsPlayerInArray(g_aChosenPlayers, id))
    13.                 continue
    14.         }
    15.  
    16.         Set_User_Zombie(id)
    17.         set_entvar(id, var_health, get_pcvar_float(g_pCvarFirstZombiesHealth))
    18.         g_bIsZombieFrozen[id] = true
    19.         g_bZombieFreezeTime = true
    20.         set_entvar(id, var_maxspeed, 1.0)
    21.         set_task(0.1, "Freeze_Zombies", FREEZE_ZOMBIES, _, _, "b") // Better than PreThink
    22.         ExecuteForward(g_iForwards[FORWARD_ZOMBIE_APPEAR], g_iFwReturn)
    23.         iZombies++
    24.        
    25.         // Respawn Zombies to base
    26.         rg_round_respawn(id)
    27.     }
Find:
    1.     if (g_bGameStarted)
    2.     {
    3.         if (g_iRoundNum == 1)
    4.         {
    5.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    6.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 2
    7.         }
    8.         else
    9.         {
    10.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    11.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 3
    12.         }
    13.     }
And to edit it to:
    1.     if (g_bGameStarted)
    2.     {
    3.         if (g_iRoundNum == 1)
    4.         {
    5.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    6.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 2
    7.         }
    8.         else
    9.         {
    10.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    11.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 3
    12.         }
    13.     }
Find: Edit it to: Find:
    1. // Variables
    2. new g_iAliveHumansNum,
    3.     g_iAliveZombiesNum,
    4.     g_iRoundTime,
    5.     g_iCountDown,
    6.     g_iReleaseNotice,
    7.     g_iMaxClients,
    8.     g_iHumansScore,
    9.     g_iZombiesScore,
    10.     g_iRoundNum,
    11.     g_iHSpeedFactor[33],
    12.     g_iZSpeedSet[33],
    13.     g_iUserGravity[33],
    14.     bool:g_bGameStarted,
    15.     bool:g_bIsZombie[33],
    16.     bool:g_bIsZombieFrozen[33],
    17.     bool:g_bZombieFreezeTime,
    18.     bool:g_bIsRoundEnding,
    19.     bool:g_bHSpeedUsed[33],
    20.     bool:g_bZSpeedUsed[33],
    21.     bool:g_bEndCalled,
    22.     bool:g_bIsKnockBackUsed[33],
    23.     bool:g_bIsGravityUsed[33],
    24.     bool:g_bEnteredNotChoosed[33],
    25.     Float:g_flReferenceTime,
    26.     Float:g_flUserKnockback[33],
Edit to (only added Float:g_flReferenceTime2):
    1. // Variables
    2. new g_iAliveHumansNum,
    3.     g_iAliveZombiesNum,
    4.     g_iRoundTime,
    5.     g_iCountDown,
    6.     g_iReleaseNotice,
    7.     g_iMaxClients,
    8.     g_iHumansScore,
    9.     g_iZombiesScore,
    10.     g_iRoundNum,
    11.     g_iHSpeedFactor[33],
    12.     g_iZSpeedSet[33],
    13.     g_iUserGravity[33],
    14.     bool:g_bGameStarted,
    15.     bool:g_bIsZombie[33],
    16.     bool:g_bIsZombieFrozen[33],
    17.     bool:g_bZombieFreezeTime,
    18.     bool:g_bIsRoundEnding,
    19.     bool:g_bHSpeedUsed[33],
    20.     bool:g_bZSpeedUsed[33],
    21.     bool:g_bEndCalled,
    22.     bool:g_bIsKnockBackUsed[33],
    23.     bool:g_bIsGravityUsed[33],
    24.     bool:g_bEnteredNotChoosed[33],
    25.     Float:g_flReferenceTime,
    26.     Float:g_flUserKnockback[33],
    27.     Float:g_flReferenceTime2
Find:
    1. public Fw_PlayerSpawn_Post(id)
    2. {  
    3.     if (!g_bGameStarted)
    4.     {
    5.         // Force All player to be Humans if Game not started yet
    6.         rg_set_user_team(id, TEAM_CT, MODEL_UNASSIGNED)
    7.     }
    8.     else
    9.     {
    10.         if (get_member_game(m_bFreezePeriod))
    11.         {
    12.             // Respawn Him As human if we are in freeze time (Zombie Not Chosen yet)
    13.             Set_User_Human(id)
    14.             g_bIsZombieFrozen[id] = false
    15.         }
    16.         else
    17.         {
    18.             if (g_bZombieFreezeTime)
    19.             {
    20.                 // Zombie Chosen and zombies Frozen, Spawn him as zombie and Freeze Him
    21.                 Set_User_Zombie(id)
    22.                 g_bIsZombieFrozen[id] = true
    23.                 set_entvar(id, var_maxspeed, 1.0)
    24.             }
    25.             else
    26.             {
    27.                 // Respawn him as normal zombie
    28.                 Set_User_Zombie(id)
    29.                 g_bIsZombieFrozen[id] = false
    30.             }
    31.         }
    32.     }
    33. }
Edit it to:
    1. public Fw_PlayerSpawn_Post(id)
    2. {  
    3.     if (!g_bGameStarted)
    4.     {
    5.         // Force All player to be Humans if Game not started yet
    6.         rg_set_user_team(id, TEAM_CT, MODEL_UNASSIGNED)
    7.     }
    8.     else
    9.     {
    10.         if ((floatround(g_flReferenceTime2)+get_pcvar_num(g_pCvarFreezeTime)) > floatround(get_gametime())+2)
    11.         {
    12.             // Respawn Him As human if we are in freeze time (Zombie Not Chosen yet)
    13.             Set_User_Human(id)
    14.             g_bIsZombieFrozen[id] = false
    15.         }
    16.         else
    17.         {
    18.             if (g_bZombieFreezeTime)
    19.             {
    20.                 // Zombie Chosen and zombies Frozen, Spawn him as zombie and Freeze Him
    21.                 Set_User_Zombie(id)
    22.                 g_bIsZombieFrozen[id] = true
    23.                 set_entvar(id, var_maxspeed, 1.0)
    24.             }
    25.             else
    26.             {
    27.                 // Respawn him as normal zombie
    28.                 Set_User_Zombie(id)
    29.                 g_bIsZombieFrozen[id] = false
    30.             }
    31.         }
    32.     }
    33. }
Finally Edit:
    1. public New_Round()
    2. {
    3.     if (g_bGameStarted)
    4.     {
    5.         g_iRoundNum++
    6.     }
    7.    
    8.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED_PRE], g_iFwReturn)
    9.    
    10.     if (g_iFwReturn > 0)
    11.     {
    12.         return
    13.     }
    14.    
    15.     // Remove All tasks in the New Round
    16.     remove_task(TASK_COUNTDOWN)
    17.     remove_task(TASK_COUNTDOWN2)
    18.     remove_task(TASK_SCORE_MESSAGE)
    19.     remove_task(FREEZE_ZOMBIES)
    20.    
    21.     // Score Message Task
    22.     set_task(10.0, "Score_Message", TASK_SCORE_MESSAGE, _, _, "b")
    23.    
    24.     if (g_bGameStarted)
    25.     {
    26.         if (g_iRoundNum == 1)
    27.         {
    28.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    29.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 2
    30.         }
    31.         else
    32.         {
    33.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    34.             g_iCountDown = get_member_game(m_iIntroRoundTime) - 3
    35.         }
    36.     }
    37.    
    38.     if (!g_bGameStarted)
    39.     {
    40.         // No Enough Players
    41.         ze_colored_print(0, "%L", LANG_PLAYER, "NO_ENOUGH_PLAYERS", get_pcvar_num(g_pCvarReqPlayers))
    42.         return // Block the execution of the blew code
    43.     }
    44.    
    45.     // Game Already started, Countdown now started
    46.     set_task(1.0, "Countdown_Start", TASK_COUNTDOWN, _, _, "b")
    47.     ze_colored_print(0, "%L", LANG_PLAYER, "READY_TO_RUN")
    48.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED], g_iFwReturn)
    49.    
    50.     // Round Starting
    51.     g_bIsRoundEnding = false
    52.     g_bEndCalled = false
    53. }
TO (Only added: g_flReferenceTime2 = get_gametime()):
    1. public New_Round()
    2. {
    3.     g_flReferenceTime2 = get_gametime()
    4.    
    5.     if (g_bGameStarted)
    6.     {
    7.         g_iRoundNum++
    8.     }
    9.    
    10.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED_PRE], g_iFwReturn)
    11.    
    12.     if (g_iFwReturn > 0)
    13.     {
    14.         return
    15.     }
    16.    
    17.     // Remove All tasks in the New Round
    18.     remove_task(TASK_COUNTDOWN)
    19.     remove_task(TASK_COUNTDOWN2)
    20.     remove_task(TASK_SCORE_MESSAGE)
    21.     remove_task(FREEZE_ZOMBIES)
    22.    
    23.     // Score Message Task
    24.     set_task(10.0, "Score_Message", TASK_SCORE_MESSAGE, _, _, "b")
    25.    
    26.     if (g_bGameStarted)
    27.     {
    28.         if (g_iRoundNum == 1)
    29.         {
    30.             // 2 is Hardcoded Value, It's Fix for the countdown to work correctly first round
    31.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 2
    32.         }
    33.         else
    34.         {
    35.             // 3 is Hardcoded Value, It's Fix for the countdown to work correctly after first round
    36.             g_iCountDown = get_pcvar_num(g_pCvarFreezeTime) - 3
    37.         }
    38.     }
    39.    
    40.     if (!g_bGameStarted)
    41.     {
    42.         // No Enough Players
    43.         ze_colored_print(0, "%L", LANG_PLAYER, "NO_ENOUGH_PLAYERS", get_pcvar_num(g_pCvarReqPlayers))
    44.         return // Block the execution of the blew code
    45.     }
    46.    
    47.     // Game Already started, Countdown now started
    48.     set_task(1.0, "Countdown_Start", TASK_COUNTDOWN, _, _, "b")
    49.     ze_colored_print(0, "%L", LANG_PLAYER, "READY_TO_RUN")
    50.     ExecuteForward(g_iForwards[FORWARD_GAME_STARTED], g_iFwReturn)
    51.    
    52.     // Round Starting
    53.     g_bIsRoundEnding = false
    54.     g_bEndCalled = false
    55. }
Now finally you will need to open zombie_escape.cfg and find mp_freezetime and make it zero. And find ze_freeze_time and make it any value, for example: ze_freeze_time 20. Also open server.cfg and make sure that mp_freezetime is set to zero.

That's it and Have fun, by the way i hate this idea but made it as TUT because it came in the ideas of our new mod version: #14
working with 1.5 too but if players left the server in countdown it restarts that round can u fix it raheem plz?
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000

karan
Mod Tester
Mod Tester
India
Posts: 89
Joined: 2 Years Ago
Location: India
Has thanked: 2 times
Been thanked: 5 times
Age: 22
Contact:

#7

Post by karan » 3 Months Ago

@Raheem ? more info if anyone connect in countdown after freezetime it works fine but if anyone leaves the sv in that countdown its restart that round
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000

karan
Mod Tester
Mod Tester
India
Posts: 89
Joined: 2 Years Ago
Location: India
Has thanked: 2 times
Been thanked: 5 times
Age: 22
Contact:

#8

Post by karan » 3 Months Ago

the problem is not in freezetime but in this gameplay countdown is longer that freezetime e.g. freezetime 10 sec nd countdown 20 sec
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000

User avatar
DarkZombie
Member
Member
Hungary
Posts: 76
Joined: 1 Year Ago
Donation: 1x donated in total €6.00
Has thanked: 16 times
Been thanked: 0
Contact:

#9

Post by DarkZombie » 2 Months Ago

Has anyone already fixed the bug? That server restart.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1998
Joined: 3 Years Ago
Location: Egypt
Has thanked: 33 times
Been thanked: 111 times
Age: 22
Contact:

#10

Post by Raheem » 2 Months Ago

Can someone give me the final edited ze_core.sma I test it and see what is the problem?
Loading Raheem's signature, Please wait...
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest