ZombieX Reloaded Development

Discussion in 'Coding' started by Halt, May 14, 2017.

Thread Status:
Not open for further replies.
  1. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Current Dev Team:

    Programmers

    • bSun Halt
    • Riotline
    • [GR]Ant_8490{A}

    Graphics Design
    • TheS4rr<3
    Modelers
    • xDShot

    -----------------------------------------------------------------------------------------------------------------------------------------
    Mod Status: Alpha 1.2
    Projected Release Date: Saturday, June 3rd


    Features:
    • Prep time 60 seconds
    • Round time 5 minutes
    • Zombie are no longer green. Replaced with models
    • No Perks (As of now)
    • Better maps, more well made with a higher quality.
    Effects:
    • Tombstones where humans die
    • Zombies spawn from ground
    • Explode command (zombie only) damaging all humans withing small radius
    • Zombies on fire (No damage)
    • [Admin] hovers over admins
    • If you are a forums member you will have the ability to use special effects
    • [Possible] Artillery strikes
     
    #1 Halt, May 14, 2017
    Last edited: May 16, 2017
  2. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Updated.
     
  3. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Player tags that float above player heads.

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
     
    Avalon™, Gadunka, Kairi and 3 others like this.
  4. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Updated, release date announced publicly.
     
    Kairi, Avalon™, Davet and 4 others like this.
  5. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Updated. Release date pushed back. New release date Saturday, June 3rd.
     
  6. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Update. Mod release is currently on schedule. We will be experiencing issues with overlays unfortunately.
     
  7. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    With the current issues of the timer not running properly and some errors upon spawning i.e. zombies with guns or zombies not green. I revamped ALL blocks and pieces of code that deal with such matters, below I provided the old and new blocks/lines of code.

    Code:
    //Old
    public Action At_Player_Spawn(Handle event, const String:name[], bool:dontBroadcast)
    {
        new Client = GetClientOfUserId(GetEventInt(event, "userid"));
        PlayerSpawnTimer[Client] = false;
        bIsPlayerAlive[Client] = true;
        ZomPoints[Client] = 0;
        KillStreak[Client] = 0;
        PlayerTeam[Client] = TF2_GetClientTeam(Client);
        CreateTimer(2.0, SpawnTimer, GetEventInt(event, "userid"), TIMER_FLAG_NO_MAPCHANGE);
        if    (HasRoundStarted)
        {
            bIsPlayerZombie[Client] = true;
            CreateTimer(0.5, WeaponStrip, GetClientUserId(Client));
            SetEntityRenderColor(Client, 0, 255, 0, 255);
        }
        if    (!HasRoundStarted)
            bIsPlayerZombie[Client] = false;
        if    (PlayerTeam[Client] == TFTeam_Blue && HasRoundStarted && bIsPlayerZombie[Client])
            TF2_ChangeClientTeam(Client, TFTeam_Red);
        else if(PlayerTeam[Client] == TFTeam_Red && !HasRoundStarted)
        {
            TF2_ChangeClientTeam(Client, TFTeam_Blue);
            CreateTimer(0.5, RespawnPlayer, GetEventInt(event, "userid"));
        }
        if    (TF2_GetPlayerClass(Client) == TFClass_Spy)
            CreateTimer(0.3, RemoveSpyStuff, GetEventInt(event, "userid"), TIMER_FLAG_NO_MAPCHANGE);
       
        if    (!bIsPlayerZombie[Client])
            SetEntityRenderColor(Client, 255, 255, 255, 255);
    }
    
    
    //New
    public Action At_Player_Spawn(Handle event, const String:name[], bool:dontBroadcast)
    {
        new Client = GetClientOfUserId(GetEventInt(event, "userid"));
        PlayerSpawnTimer[Client] = false;
        bIsPlayerAlive[Client] = true;
        ZomPoints[Client] = 0;
        //KillStreak[Client] = 0;
        PlayerTeam[Client] = TF2_GetClientTeam(Client);
        CreateTimer(2.0, SpawnTimer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
        if    (HasRoundStarted)
        {
            bIsPlayerZombie[Client] = true;
            CreateTimer(0.5, WeaponStrip, GetClientUserId(Client));
            SetEntityRenderColor(Client, 0, 255, 0, 255);
        }
        if    (HasRoundStarted && PlayerTeam[Client] == TFTeam_Blue)
        {
            TF2_ChangeClientTeam(Client, TFTeam_Red);
            CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client));
        }
        else if(PlayerTeam[Client] == TFTeam_Red && !HasRoundStarted)
        {
            TF2_ChangeClientTeam(Client, TFTeam_Blue);
            CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client));
        }
        if    (TF2_GetPlayerClass(Client) == TFClass_Spy)
            CreateTimer(0.3, RemoveSpyStuff, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
       
        if    (!HasRoundStarted)
            SetEntityRenderColor(Client, 255, 255, 255, 255);
    }
    
    
    //Old
    public Action At_Player_Death(Event event, const char[] name, bool dontBroadcast) 
    {
        int Client = GetClientOfUserId(GetEventInt(event, "userid"));
        int Attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
        if    (HasRoundStarted)
            bIsPlayerAlive[Client] = false;
        CreateTimer(0.3, RespawnPlayer, GetEventInt(event, "userid"), TIMER_FLAG_NO_MAPCHANGE);
        if    (bIsPlayerAlive[Attacker] && !bIsPlayerZombie[Attacker])
        {
            ZomPoints[Attacker] += 1;
            KillStreak[Attacker] += 1;
        }
        else if (bIsPlayerAlive[Attacker] && !bIsPlayerZombie[Attacker] && IsPlayerMember[Attacker])
        {
            ZomPoints[Attacker] += 2;
        }
        if    (!bIsPlayerZombie[Client] && bIsPlayerZombie[Attacker] && HasRoundStarted)
        {
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x0730FF31%N \x07e3f010has eaten \x0730FF31%N!", Attacker, Client);
            if    (GetTeamClientCount(2) >= 5 && GetTeamClientCount(3) == 1 && HasRoundStarted)
            {
                for    (new LastMan = 1; LastMan <= MaxClients; LastMan++)
                {
                    if    (IsClientInGame(LastMan) && PlayerTeam[LastMan] == TFTeam_Blue && bIsPlayerAlive[LastMan])
                    {
                        CreateTimer(0.3, LastHumanTimer, LastMan, TIMER_FLAG_NO_MAPCHANGE); //Dont pass client thorugh timer
                    }
                }
            }
        }
        if    (TF2_GetClientTeam(Client) == TFTeam_Blue && bIsPlayerZombie[Client] == false && HasRoundStarted)
        {
            float coordinates[3];
            GetClientAbsOrigin(Client, coordinates);
            GetEntPropVector(Client, Prop_Send, "m_vecOrigin", coordinates);
           
            int Entity = CreateEntityByName("prop_dynamic_override");
            SetEntityModel(Entity, "models/props_gameplay/tombstone_tankbuster.mdl");
            TeleportEntity(Entity, coordinates, NULL_VECTOR, NULL_VECTOR);
            DispatchSpawn(Entity);
    
        }
        if    (GetTeamClientCount(2) >= 1 && GetTeamClientCount(3) <= 0 && HasRoundStarted)
        {
            ServerCommand("mp_forcewin 2");
            //CreateTimer(1.0, ResetRound, TIMER_FLAG_NO_MAPCHANGE)
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Humanity has failed. Zombies Win!");
            EmitSoundToAll("ui/halloween_boss_summoned_monoculus.wav");
        }
    }
    
    
    //New
    public Action At_Player_Death(Event event, const char[] name, bool dontBroadcast) 
    {
        int Client = GetClientOfUserId(GetEventInt(event, "userid"));
        int Attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
        if    (HasRoundStarted)
            bIsPlayerAlive[Client] = false;
       
        if    (bIsPlayerAlive[Attacker] && !bIsPlayerZombie[Attacker])
            ZomPoints[Attacker] += 1;
       
        if    (!bIsPlayerZombie[Client] && bIsPlayerZombie[Attacker])
        {
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x0730FF31%N \x07e3f010has eaten \x0730FF31%N!", Attacker, Client);
            if    (GetTeamClientCount(2) >= 5 && GetTeamClientCount(3) == 1 && HasRoundStarted)
            {
                for    (new LastMan = 1; LastMan <= MaxClients; LastMan++)
                {
                    if    (IsClientInGame(LastMan) && PlayerTeam[LastMan] == TFTeam_Blue && bIsPlayerAlive[LastMan])
                    {
                        CreateTimer(0.3, LastHumanTimer, GetClientUserId(LastMan), TIMER_FLAG_NO_MAPCHANGE); //Dont pass client thorugh timer
                    }
                }
            }
        }
       
        if    (TF2_GetClientTeam(Client) == TFTeam_Blue && bIsPlayerZombie[Client] == false && HasRoundStarted)
        {
            float coordinates[3];
            GetClientAbsOrigin(Client, coordinates);
            GetEntPropVector(Client, Prop_Send, "m_vecOrigin", coordinates);
           
            int Entity = CreateEntityByName("prop_dynamic_override");
            SetEntityModel(Entity, "models/props_gameplay/tombstone_tankbuster.mdl");
            TeleportEntity(Entity, coordinates, NULL_VECTOR, NULL_VECTOR);
            DispatchSpawn(Entity);
        }
       
        if    (GetTeamClientCount(2) >= 1 && GetTeamClientCount(3) <= 0 && HasRoundStarted)
        {
            ServerCommand("mp_forcewin 2");
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Humanity has failed. Zombies Win!");
            EmitSoundToAll("ui/halloween_boss_summoned_monoculus.wav");
            CreateTimer(1.0, ResetGame);
        }
       
        CreateTimer(0.3, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
    }
    
    
    //New
    public Action StartRound(Handle timer, any Data)
    {
        if    (!HasWaitingTimeEnded)
        {
            HasWaitingTimeEnded = true;
            ServerCommand("mp_cancelwaitingforplayers 1");
            CreateTimer(32.0, GetZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Next round begins in 30 seconds!");
        }
        else if    (HasWaitingTimeEnded)
        {
            HasRoundStarted = false;
            CreateTimer(30.0, GetZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Next round begins in 30 seconds!");
        }
    }
    
    public Action ResetGame(Handle timer, any Data) //InGameClients
    {
        for    (new IGC; IGC <= MaxClients; IGC++)
        {
            if    (IsClientInGame(IGC) && bIsPlayerZombie[IGC])
            {
                TF2_ChangeClientTeam(IGC, TFTeam_Blue);
                CreateTimer(0.5, RespawnPlayer, GetClientUserId(IGC));
                bIsPlayerZombie[IGC] = false;
            }
        }
    }
     
    Davet likes this.
  8. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    I've decided to make the mod more game event directed. I.e. when game events fire is when the mods wheels start turning. Instead of trying to predict the game before hand and trying to sync the mod with it like I was doing in the past. A few changes are as follows.


    //New
    Code:
    bool IsWaitingForPlayersOver = false;
    HookEvent("teamplay_waiting_begins", At_Waiting_For_Players_Start);
    HookEvent("teamplay_waiting_ends", At_Waiting_For_Players_End);

    //New
    Code:
    public Action At_Waiting_For_Players_Start(Event event, const char[] name, bool dontBroadcast)
    {
        IsWaitingForPlayersOver = false;
    }
    
    public Action At_Waiting_For_Players_End(Event event, const char[] name, bool dontBroadcast)
    {
        IsWaitingForPlayersOver = true;
    }
    //New
    Code:
    public Action RoundStarts(Event event, const char[] name, bool dontBroadcast)
    {
        if    (IsWaitingForPlayersOver && GetClientCount(false) >= 2)
        {
            CreateTimer(30.0, GetZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Next round begins in 30 seconds!");
        }
        else if    (!IsWaitingForPlayersOver && GetClientCount(false) >= 2)
            ServerCommand("mp_restartgame 1");
        HasRoundStarted = true;
    }

    //Old
    Code:
    public Action RoundStarts(Event event, const char[] name, bool dontBroadcast)
    {
        if    (!HasWaitingTimeEnded && GetClientCount(false) >= 2)
        {
            CreateTimer(5.0, EndWaitingTime, TIMER_FLAG_NO_MAPCHANGE);
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Waiting for all players to connect!");
        }
        if    (HasWaitingTimeEnded && GetClientCount(false) >= 2)
        {
            CreateTimer(30.0, GetZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Next round begins in 30 seconds!");
        }
        CreateTimer(31.0, CheckZombieTimer, TIMER_FLAG_NO_MAPCHANGE)
        HasRoundStarted = true;
    }
     
  9. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Many of the changes here are possible errors in the order of setting bools. I've also cut out many re-occuring if statments and simply created nested if statments. I've also adjusted all respawn timers and weapon strip timers to 0.5 second delays. This will be the new minimum time limit for firing timers giving the mod plenty of time to process timers. I've also adjusted where and how often bool values are set. In the old code it was somtimes repetative in the new code bools are only set where they NEED to be set. I've also adjusted adjusted the loop that should find all zombies and make them human on round restart. Now all human and zombie attributes are set At_Player_Spawn. The loop only forces a client to re-spawn now if they were a zombie last round.

    //Old
    Code:
    public Action At_Player_Spawn(Handle event, const char[] name, bool dontBroadcast)
    {
        int Client = GetClientOfUserId(GetEventInt(event, "userid"));
        PlayerSpawnTimer[Client] = false;
        bIsPlayerAlive[Client] = true;
        ZomPoints[Client] = 0;
        //KillStreak[Client] = 0;
        PlayerTeam[Client] = TF2_GetClientTeam(Client);
        CreateTimer(2.0, SpawnTimer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
      
        if    (HasRoundStarted)
        {
            bIsPlayerZombie[Client] = true;
            CreateTimer(0.5, WeaponStrip, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
            SetEntityRenderColor(Client, 0, 255, 0, 255);
        }
        if    (HasRoundStarted && PlayerTeam[Client] == TFTeam_Blue)
        {
            TF2_ChangeClientTeam(Client, TFTeam_Red);
            CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
        }
        else if(PlayerTeam[Client] == TFTeam_Red && !HasRoundStarted)
        {
            TF2_ChangeClientTeam(Client, TFTeam_Blue);
            CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
        }
        if    (TF2_GetPlayerClass(Client) == TFClass_Spy)
            CreateTimer(0.3, RemoveSpyStuff, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
      
        if    (!HasRoundStarted)
        {
            SetEntityRenderColor(Client, 255, 255, 255, 255);
            bIsPlayerZombie[Client] = false;
        }
    }
    //New
    Code:
    public Action At_Player_Spawn(Handle event, const char[] name, bool dontBroadcast)
    {
        int Client = GetClientOfUserId(GetEventInt(event, "userid"));
      
        PlayerSpawnTimer[Client] = false;
        bIsPlayerAlive[Client] = true;
        ZomPoints[Client] = 0;
        PlayerTeam[Client] = TF2_GetClientTeam;
      
        CreateTimer(5.0, SpawnTimer, GetClientOfUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
      
        if    (HasRoundStarted)
        {
            bIsPlayerZombie[Client] = true;
          
            if    (PlayerTeam[Client] == TFTeam_Blue)
            {
                SetEntityRenderColor(Client, 0, 255, 0, 255);
                TF2_ChangeClientTeam(Client, TFTeam_Red);
                CreateTimer(0.5, WeaponStrip, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
                CreateTimer(0.5, RespawnPlayer, GetClientOfUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
            }
        }
      
        if    (!HasRoundStarted)
        {
            bIsPlayerZombie[Client] = false;
          
            if    (PlayerTeam[Client] == TFTeam_Red)
            {
                TF2_ChangeClientTeam(Client, TFTeam_Blue);
                CreateTimer(0.5, RespawnPlayer, GetClientOfUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
            }
        }
      
        if    (TF2_GetPlayerClass(Client) == TFClassSpy)
            CreateTimer(0.5, RemoveSpyStuff, GetClientOfUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
    }
    //Old
    Code:
    public Action At_Player_Death(Event event, const char[] name, bool dontBroadcast)
    {
        Event RedTeamWin = CreateEvent("teamplay_round_win");
        if    (RedTeamWin == null)
        {
            return;
        }
      
        int Client = GetClientOfUserId(GetEventInt(event, "userid"));
        int Attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
        int RedTeamCount = GetAlivePlayersCount(2)
        int BlueTeamCount = GetAlivePlayersCount(3)
        if    (HasRoundStarted)
        {
            bIsPlayerAlive[Client] = false;
            TF2_ChangeClientTeam(Client, TFTeam_Red);
        }
        if    (bIsPlayerAlive[Attacker] && !bIsPlayerZombie[Attacker])
            ZomPoints[Attacker] += 1;
      
        if    (!bIsPlayerZombie[Client] && bIsPlayerZombie[Attacker])
        {
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x0730FF31%N \x07e3f010has eaten \x0730FF31%N!", Attacker, Client);
            if    (RedTeamCount && BlueTeamCount == 1 && HasRoundStarted)
            {
                for    (int LastMan = 1; LastMan <= MaxClients; LastMan++)
                {
                    if    (IsClientInGame(LastMan) && PlayerTeam[LastMan] == TFTeam_Blue && bIsPlayerAlive[LastMan])
                    {
                        CreateTimer(0.3, LastHumanTimer, GetClientUserId(LastMan), TIMER_FLAG_NO_MAPCHANGE); //Dont pass client thorugh timer
                    }
                }
            }
        }
      
        if    (TF2_GetClientTeam(Client) == TFTeam_Blue && bIsPlayerZombie[Client] == false && HasRoundStarted)
        {
            float coordinates[3];
            GetClientAbsOrigin(Client, coordinates);
            GetEntPropVector(Client, Prop_Send, "m_vecOrigin", coordinates);
          
            int Entity = CreateEntityByName("prop_dynamic_override");
            SetEntityModel(Entity, "models/props_gameplay/tombstone_tankbuster.mdl");
            TeleportEntity(Entity, coordinates, NULL_VECTOR, NULL_VECTOR);
            DispatchSpawn(Entity);
        }
        if    (RedTeamCount >= 1 && BlueTeamCount <= 0 && HasRoundStarted) //Perhaps an issue with this MUST CHECK FOR ALIVE PLAYER COUNT ADD FUNCTION THAT CHECKS ALIVE PLAYERS ON EACH TEAM
        {
            RedTeamWin.SetInt("team", 2);
            RedTeamWin.Fire();
            PrintToChatAll("Zombies win AWESOME WORKS");
        }
        CreateTimer(0.3, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
    }
    //New
    Code:
    public Action At_Player_Death(Event event, const char[] name, bool dontBroadcast)
    {
        int Client = GetClientOfUserId(GetEventInt(event, "userid"));
        int Attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
        int RedTeamCount = GetAlivePlayersCount(2)
        int BlueTeamCount = GetAlivePlayersCount(3)
        PlayerTeam[Client] = TF2_GetClientTeam;
        bIsPlayerAlive[Client] = false;
      
        if    (bIsPlayerAlive[Attacker] && !bIsPlayerZombie[Attacker])
            ZomPoints[Attacker] += 1;
      
        if    (HasRoundStarted)
        {
            if    (PlayerTeam[Client] == TFTeam_Blue && !bIsPlayerZombie[Client])
            {
                float coordinates[3];
                GetClientAbsOrigin(Client, coordinates);
                GetEntPropVector(Client, Prop_Send, "m_vecOrigin", coordinates);
          
                int Entity = CreateEntityByName("prop_dynamic_override");
                SetEntityModel(Entity, "models/props_gameplay/tombstone_tankbuster.mdl");
                TeleportEntity(Entity, coordinates, NULL_VECTOR, NULL_VECTOR);
                DispatchSpawn(Entity);
            }
          
            if    (PlayerTeam[Client] == TFTeam_Blue)
            {
                TF2_ChangeClientTeam(Client, TFTeam_Red)
                CreateTimer(0.5, RespawnPlayer, GetClientOfUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
            }
          
            if    (RedTeamCount >= 1 && BlueTeamCount <= 0)
            {
                ServerCommand("mp_forcewin 2");
                PrintToChatAll("mp_forcewin fired zombies win");
            }
        }
    }
     
    Varyim likes this.
  10. Halt

    Halt Can I get a bite?
    Developer Admin

    Joined:
    Jan 3, 2016
    Messages:
    254
    Likes Received:
    234
    Post split into 2 due to max 10k character limit per post.

    //Old
    Code:
    public void OnClientPutInServer(int Client)
    {
        //bIsPlayerZombie[Client] = false;
        if    (!IsClientConnected(Client))
            return;
        PrintToChatAll("\x0730FF31%N \x07e3f010has connected for \x07ff2929BRAINZ", Client);
        SDKHook(Client, SDKHook_OnTakeDamage, OnTakeDamage);
     
        TF2_ChangeClientTeam(Client, TFTeam_Blue);
        TF2_SetPlayerClass(Client, TFClass_Pyro);
        CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
    }
    //New
    Code:
    public void OnClientPutInServer(int Client)
    {
        if    (!IsClientConnected(Client))
            return;
     
        PrintToChatAll("\x0730FF31%N \x07e3f010has connected for \x07ff2929BRAINZ", Client);
        SDKHook(Client, SDKHook_OnTakeDamage, OnTakeDamage);
        TF2_SetPlayerClass(Client, TFClass_Pyro);
        if(!HasRoundStarted)
            TF2_ChangeClientTeam(Client, TFTeam_Blue);
        CreateTimer(0.5, RespawnPlayer, GetClientUserId(Client), TIMER_FLAG_NO_MAPCHANGE);
    }
    //Old
    Code:
    public Action RoundWin(Event event, const char[] name, bool dontBroadcast)
    {
        TFTeam WinningTeam = view_as< TFTeam >( event.GetInt("team"));
        if    (WinningTeam == TFTeam_Red)
        {
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Humanity has failed. Zombies Win!");
            EmitSoundToAll("ui/halloween_boss_summoned_monoculus.wav");
        }
     
        else if    (WinningTeam == TFTeam_Blue)
        {
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Humans have prevailed!");
        }
     
        for    (int IGC; IGC <= MaxClients; IGC++)
        {
            if    (IsClientInGame(IGC) && bIsPlayerZombie[IGC])
            {
                TF2_ChangeClientTeam(IGC, TFTeam_Blue);
                bIsPlayerZombie[IGC] = false;
                CreateTimer(0.5, RespawnPlayer, GetClientUserId(IGC), TIMER_FLAG_NO_MAPCHANGE);
                PrintToChat(IGC, "You've been changed to blue team");
            }
        }
        HasRoundStarted = false;
    }
    //New
    Code:
    public Action RoundWin(Event event, const char[] name, bool dontBroadcast)
    {
        HasRoundStarted = false;
        TFTeam WinningTeam = view_as< TFTeam >( event.GetInt("team"));
     
        if    (WinningTeam == TFTeam_Red)
        {
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Humanity has failed. Zombies Win!");
            EmitSoundToAll("ui/halloween_boss_summoned_monoculus.wav");
        }
        else if    (WinningTeam == TFTeam_Blue)
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Humans have prevailed!");
     
        for    (int IGC; IGC <= MaxClients; IGC++)
        {
            if    (IsClientInGame(IGC) && bIsPlayerZombie[IGC])
            {
                CreateTimer(0.5, RespawnPlayer, GetClientUserId(IGC), TIMER_FLAG_NO_MAPCHANGE);
                PrintToChatAll(IGC, "You've been respawned cuz u were a zambie");
            }
        }
    }
    //Old
    Code:
    public Action RoundStarts(Event event, const char[] name, bool dontBroadcast)
    {
        if    (IsWaitingForPlayersOver && GetClientCount(false) >= 2)
        {
            CreateTimer(30.0, GetZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Next round begins in 30 seconds!");
        }
        else if    (!IsWaitingForPlayersOver && GetClientCount(false) >= 2)
            ServerCommand("mp_restartgame 1");
     
        CreateTimer(32.0, CheckZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
    }
    //New
    Code:
    public Action RoundStarts(Event event, const char[] name, bool dontBroadcast)
    {
        if    (GetClientCount(false) >= 2)
        {
            if    (IsWaitingForPlayersOver)
            {
                CreateTimer(30.0, GetZombieTimer, TIMER_FLAG_NO_MAPCHANGE);
                PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Next round begins in 30 seconds!");
            }
          
            if    (!IsWaitingForPlayersOver)
            {
                PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010Waiting for all players to connect!");
            }
        }
     
        if    (GetClientCount(false) <= 1)
            PrintToChatAll("\x07ff2929[\x0730FF31ZomXR\x07ff2929] - \x07e3f010You need 2 players to play!");
    }
     
    Varyim likes this.
Thread Status:
Not open for further replies.
  • Zombie Survival

    Coming in 2017
  • Our Thanks

    We'd like to thank all who play, run, and help develop the community further and to where it is at today. Past, present, and future members have returned when Black Sun Studios returns. We'd personally like to thank you all for taking part in this amazing community.
  • Join the Discord

    Our discord server can be found below, there you will find the regulars playing all games from Team Fortress 2, Dead by Daylight, Terraria, Garry's Mod, and more. Or just come chill in the lounge and chat with everyone and even listen to music. Check it out, its a good time. Click here to join our Discord server!