Raised This Month: $32 Target: $400
 8% 

[L4D2] How I can add two tanks on the final waves ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rtokuda
Senior Member
Join Date: Dec 2019
Old 07-27-2020 , 17:24   [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #1

Could someone make a plugin that spawns another tank in final waves on these maps:

-No Mercy
-Crash Course
-Death Toll
-Dead Air
-Blood Harvest
-The Sacrifice

I already tried to use Cravenge's MultiTanks, but I didn't get results in spawning two tanks in the final L4D1 campaigns
rtokuda is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 07-27-2020 , 20:48   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #2

What mode? Coop ?
__________________

Last edited by HarryPotter; 07-27-2020 at 20:48.
HarryPotter is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 07-27-2020 , 21:37   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #3

Quote:
Originally Posted by fbef0102 View Post
What mode? Coop ?
Yes, on dedicated servers in cooperative mode
rtokuda is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 07-27-2020 , 21:50   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #4

Cravenge's MultiTanks

use multitanks_b-l4d2.sp?
or multitanks_a-l4d2.sp?

If I modify, you have to remove left4downtown and install l4dhooks with sm 1.10 or above.
Is that okay?
__________________

Last edited by HarryPotter; 07-27-2020 at 21:53.
HarryPotter is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 07-27-2020 , 22:52   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #5

Quote:
Originally Posted by fbef0102 View Post
Cravenge's MultiTanks

use multitanks_b-l4d2.sp?
or multitanks_a-l4d2.sp?

If I modify, you have to remove left4downtown and install l4dhooks with sm 1.10 or above.
Is that okay?

I'm using multitanks_a-l4d2, he can't spawn more than one tank in final waves of L4d1 maps
rtokuda is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 07-27-2020 , 23:04   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #6

I replaced "<left4downtown>" with "<l4d hooks>" and compiled, it doesn't work properly on L4d1 maps:

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <dhooks>
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "1.4"

enum GameModeStatus
{
    
GMS_UNKNOWN 0,
    
GMS_COOP 1,
    
GMS_VERSUS 2,
    
GMS_SURVIVAL 3,
    
GMS_SCAVENGE 4
};

enum MapStatus
{
    
MS_UNKNOWN 0,
    
MS_REGULAR 1,
    
MS_FINALE 2,
    
MS_ESCAPE 3,
    
MS_LEAVING 4,
    
MS_ROUNDEND 5
};

char sLabels[5][] =
{
    
"regular""finale""1stwave""2ndwave""escape"
};

GameModeStatus gmsBase;
MapStatus msBase;
int iMaxZombiesiFrustration[MAXPLAYERS+1], iMTHealthCoop[5], iMTHealthVersus[5], iMTHealthSurvival,
    
iMTHealthScavengeiMTCountCoop[5], iMTCountVersus[5], iMTCountSurvivaliMTCountScavenge,
    
iFinaleWaveiTankHPiTankCountiMaxTankCount;

bool bRoundBeganbRoundFinishedbFrustrated[MAXPLAYERS+1], bIsTank[MAXPLAYERS+1], bMTOnbMTAnnounce,
    
bMTSameSpawn[3], bMTDisplaybFirstSpawned;

float fTankPos[3], fMTSpawnDelay[2];
ConVar hMTOnhMTHealthCoop[5], hMTHealthVersus[5], hMTHealthSurvivalhMTHealthScavengehMTCountCoop[5],
    
hMTCountVersus[5], hMTCountSurvivalhMTCountScavengehMTAnnouncehMTSameSpawn[3], hMTSpawnDelay[2],
    
hMTDisplayhGameMode;

Panel pMTList;

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    
char sGameName[12];
    
GetGameFolderName(sGameNamesizeof(sGameName));
    if (
StrEqual(sGameName"left4dead2"false))
    {
        return 
APLRes_Success;
    }
    
    
strcopy(errorerr_max"[MT] Plugin Supports L4D2 Only!");
    return 
APLRes_SilentFailure;
}

public 
Plugin myinfo =
{
    
name "MultiTanks - Improved",
    
author "Red Alex, cravenge",
    
description "This Time, Let All Hell Break Loose!",
    
version PLUGIN_VERSION,
    
url "https://forums.alliedmods.net/forumdisplay.php?f=108"
};

public 
void OnPluginStart()
{
    
hGameMode FindConVar("mp_gamemode");
    
hGameMode.AddChangeHook(OnMTCVarsChanged);
    
    
gmsBase GetGameModeInfo();
    
    
iMaxZombies = (FindConVar("super_versus_version") != null) ? FindConVar("super_versus_infected_limit").IntValue FindConVar("z_max_player_zombies").IntValue;
    
FindConVar("super_versus_version") != null FindConVar("super_versus_infected_limit").AddChangeHook(OnMTCVarsChanged) : FindConVar("z_max_player_zombies").AddChangeHook(OnMTCVarsChanged);
    
    
CreateConVar("multitanks_version"PLUGIN_VERSION"MultiTanks Version"FCVAR_NOTIFY|FCVAR_SPONLY|FCVAR_DONTRECORD);
    
hMTOn CreateConVar("multitanks_on""1""Enable/Disable Plugin"FCVAR_NOTIFY|FCVAR_SPONLY);
    
hMTHealthSurvival CreateConVar("multitanks_health_survival""17500""Health Of Tanks (Survival)"FCVAR_NOTIFY|FCVAR_SPONLY);
    
hMTCountSurvival CreateConVar("multitanks_count_survival""2""Total Count Of Tanks (Survival)"FCVAR_NOTIFY|FCVAR_SPONLY);
    
hMTHealthScavenge CreateConVar("multitanks_health_scavenge""17500""Health Of Tanks (Scavenge)"FCVAR_NOTIFY|FCVAR_SPONLY);
    
hMTCountScavenge CreateConVar("multitanks_count_scavenge""2""Total Count Of Tanks (Scavenge)"FCVAR_NOTIFY|FCVAR_SPONLY);
    
hMTAnnounce CreateConVar("multitanks_announce""1""Enable/Disable Announcements"FCVAR_NOTIFY|FCVAR_SPONLY);
    
hMTDisplay CreateConVar("multitanks_display""0""Enable/Disable HUD Display"FCVAR_NOTIFY|FCVAR_SPONLY);
    
    
iMTHealthSurvival hMTHealthSurvival.IntValue;
    
iMTCountSurvival hMTCountSurvival.IntValue;
    
iMTHealthScavenge hMTHealthScavenge.IntValue;
    
iMTCountScavenge hMTCountScavenge.IntValue;
    
    
bMTOn hMTOn.BoolValue;
    
bMTAnnounce hMTAnnounce.BoolValue;
    
bMTDisplay hMTDisplay.BoolValue;
    
    
hMTOn.AddChangeHook(OnMTCVarsChanged);
    
hMTHealthSurvival.AddChangeHook(OnMTCVarsChanged);
    
hMTCountSurvival.AddChangeHook(OnMTCVarsChanged);
    
hMTHealthScavenge.AddChangeHook(OnMTCVarsChanged);
    
hMTCountScavenge.AddChangeHook(OnMTCVarsChanged);
    
hMTAnnounce.AddChangeHook(OnMTCVarsChanged);
    
hMTDisplay.AddChangeHook(OnMTCVarsChanged);
    
    
char sDescriptions[3][128];
    for (
int i 02i++)
    {
        
StripQuotes(sLabels[i]);
        
        
Format(sDescriptions[0], 128"multitanks_spawn_delay_%s"sLabels[(== 0) ? 3]);
        switch (
i)
        {
            case 
0:
            {
                
strcopy(sDescriptions[1], 128"5.0");
                
strcopy(sDescriptions[2], 128"Delay Of Spawning Tanks");
            }
            case 
1:
            {
                
strcopy(sDescriptions[1], 128"2.5");
                
strcopy(sDescriptions[2], 128"Delay Of Spawning Tanks In Finale Escapes");
            }
        }
        
        
hMTSpawnDelay[i] = CreateConVar(sDescriptions[0], sDescriptions[1], sDescriptions[2], FCVAR_NOTIFY|FCVAR_SPONLY);
        
fMTSpawnDelay[i] = hMTSpawnDelay[i].FloatValue;
        
hMTSpawnDelay[i].AddChangeHook(OnMTCVarsChanged);
    }
    
    for (
int i 05i++)
    {
        
StripQuotes(sLabels[i]);
        
        
Format(sDescriptions[0], 128"multitanks_health_coop_%s"sLabels[i]);
        switch (
i)
        {
            case 
0:
            {
                
strcopy(sDescriptions[1], 128"17500");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Regular Maps");
            }
            case 
1:
            {
                
strcopy(sDescriptions[1], 128"20000");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Finale Maps");
            }
            case 
2:
            {
                
strcopy(sDescriptions[1], 128"25000");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In First Wave Finales");
            }
            case 
3:
            {
                
strcopy(sDescriptions[1], 128"27500");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Second Wave Finales");
            }
            case 
4:
            {
                
strcopy(sDescriptions[1], 128"22500");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Finale Escapes");
            }
        }
        
        
hMTHealthCoop[i] = CreateConVar(sDescriptions[0], sDescriptions[1], sDescriptions[2], FCVAR_NOTIFY|FCVAR_SPONLY);
        
        
Format(sDescriptions[0], 128"multitanks_count_coop_%s"sLabels[i]);
        
strcopy(sDescriptions[1], 128"1");
        switch (
i)
        {
            case 
0strcopy(sDescriptions[2], 128"Total Count Of Tanks In Regular Maps");
            case 
1strcopy(sDescriptions[2], 128"Total Count Of Tanks In Finale Maps");
            case 
2strcopy(sDescriptions[2], 128"Total Count Of Tanks In First Wave Finales");
            case 
3strcopy(sDescriptions[2], 128"Total Count Of Tanks In Second Wave Finales");
            case 
4strcopy(sDescriptions[2], 128"Total Count Of Tanks In Finale Escapes");
        }
        
        
hMTCountCoop[i] = CreateConVar(sDescriptions[0], sDescriptions[1], sDescriptions[2], FCVAR_NOTIFY|FCVAR_SPONLY);
        
        
iMTHealthCoop[i] = hMTHealthCoop[i].IntValue;
        
iMTCountCoop[i] = hMTCountCoop[i].IntValue;
        
        
hMTHealthCoop[i].AddChangeHook(OnMTCVarsChanged);
        
hMTCountCoop[i].AddChangeHook(OnMTCVarsChanged);
        
        
Format(sDescriptions[0], 128"multitanks_health_versus_%s"sLabels[i]);
        switch (
i)
        {
            case 
0:
            {
                
strcopy(sDescriptions[1], 128"15000");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Regular Maps (Versus)");
            }
            case 
1:
            {
                
strcopy(sDescriptions[1], 128"17500");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Finale Maps (Versus)");
            }
            case 
2:
            {
                
strcopy(sDescriptions[1], 128"22500");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In First Wave Finales (Versus)");
            }
            case 
3:
            {
                
strcopy(sDescriptions[1], 128"25000");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Second Wave Finales (Versus)");
            }
            case 
4:
            {
                
strcopy(sDescriptions[1], 128"20000");
                
strcopy(sDescriptions[2], 128"Health Of Tanks In Finale Escapes (Versus)");
            }
        }
        
        
hMTHealthVersus[i] = CreateConVar(sDescriptions[0], sDescriptions[1], sDescriptions[2], FCVAR_NOTIFY|FCVAR_SPONLY);
        
        
Format(sDescriptions[0], 128"multitanks_count_versus_%s"sLabels[i]);
        
strcopy(sDescriptions[1], 128"2");
        switch (
i)
        {
            case 
0strcopy(sDescriptions[2], 128"Total Count Of Tanks In Regular Maps (Versus)");
            case 
1strcopy(sDescriptions[2], 128"Total Count Of Tanks In Finale Maps (Versus)");
            case 
2strcopy(sDescriptions[2], 128"Total Count Of Tanks In First Wave Finales (Versus)");
            case 
3strcopy(sDescriptions[2], 128"Total Count Of Tanks In Second Wave Finales (Versus)");
            case 
4strcopy(sDescriptions[2], 128"Total Count Of Tanks In Finale Escapes (Versus)");
        }
        
        
hMTCountVersus[i] = CreateConVar(sDescriptions[0], sDescriptions[1], sDescriptions[2], FCVAR_NOTIFY|FCVAR_SPONLY);
        
        
iMTHealthVersus[i] = hMTHealthVersus[i].IntValue;
        
iMTCountVersus[i] = hMTCountVersus[i].IntValue;
        
        
hMTHealthVersus[i].AddChangeHook(OnMTCVarsChanged);
        
hMTCountVersus[i].AddChangeHook(OnMTCVarsChanged);
        
        if (
== || == || == 4)
        {
            
Format(sDescriptions[0], 128"multitanks_same_spawn_%s"sLabels[i]);
            
strcopy(sDescriptions[1], 128"0");
            switch (
i)
            {
                case 
0strcopy(sDescriptions[2], 128"Enable/Disable Same Spawn Of Tanks In Regular Maps");
                case 
1strcopy(sDescriptions[2], 128"Enable/Disable Same Spawn Of Tanks In Finale Maps");
                case 
4strcopy(sDescriptions[2], 128"Enable/Disable Same Spawn Of Tanks In Finale Escapes");
            }
            
            
hMTSameSpawn[(== 4) ? i] = CreateConVar(sDescriptions[0], sDescriptions[1], sDescriptions[2], FCVAR_NOTIFY|FCVAR_SPONLY);
            
bMTSameSpawn[(== 4) ? i] = hMTSameSpawn[(== 4) ? i].BoolValue;
            
hMTSameSpawn[(== 4) ? i].AddChangeHook(OnMTCVarsChanged);
        }
    }
    
    
AutoExecConfig(true"multitanks");
    
    
HookEvent("round_start"OnRoundEvents);
    
HookEvent("round_end"OnRoundEvents);
    
    
HookEvent("finale_start"OnFinaleEvents);
    
HookEvent("finale_escape_start"OnFinaleEvents);
    
HookEvent("finale_vehicle_leaving"OnFinaleEvents);
    
    
HookEvent("tank_frustrated"OnTankFrustrated);
    
HookEvent("player_death"OnPlayerDeathEventHookMode_Pre);
    
HookEvent("tank_spawn"OnTankSpawn);
}

public 
void OnMTCVarsChanged(ConVar cvar, const char[] sOldValue, const char[] sNewValue)
{
    
bMTOn hMTOn.BoolValue;
    
bMTAnnounce hMTAnnounce.BoolValue;
    
bMTDisplay hMTDisplay.BoolValue;
    
    for (
int i 05i++)
    {
        if (
== || == || == 4)
        {
            
bMTSameSpawn[(!= 4) ? 2] = hMTSameSpawn[(!= 4) ? 2].BoolValue;
        }
        
        
iMTHealthCoop[i] = hMTHealthCoop[i].IntValue;
        
iMTCountCoop[i] = hMTCountCoop[i].IntValue;
        
        
iMTHealthVersus[i] = hMTHealthVersus[i].IntValue;
        
iMTCountVersus[i] = hMTCountVersus[i].IntValue;
    }
    
    
iMaxZombies = (FindConVar("super_versus_version") != null) ? FindConVar("super_versus_infected_limit").IntValue FindConVar("z_max_player_zombies").IntValue;
    
    
iMTHealthSurvival hMTHealthSurvival.IntValue;
    
iMTCountSurvival hMTCountSurvival.IntValue;
    
iMTHealthScavenge hMTHealthScavenge.IntValue;
    
iMTCountScavenge hMTCountScavenge.IntValue;
    
    for (
int i 02i++)
    {
        
fMTSpawnDelay[i] = hMTSpawnDelay[i].FloatValue;
    }
    if (
bMTOn)
    {
        
gmsBase GetGameModeInfo();
        
LaunchMTParameters();
    }
}

public 
void OnPluginEnd()
{
    
hMTOn.RemoveChangeHook(OnMTCVarsChanged);
    
hMTHealthSurvival.RemoveChangeHook(OnMTCVarsChanged);
    
hMTCountSurvival.RemoveChangeHook(OnMTCVarsChanged);
    
hMTHealthScavenge.RemoveChangeHook(OnMTCVarsChanged);
    
hMTCountScavenge.RemoveChangeHook(OnMTCVarsChanged);
    
hMTAnnounce.RemoveChangeHook(OnMTCVarsChanged);
    
hMTDisplay.RemoveChangeHook(OnMTCVarsChanged);
    for (
int i 02i++)
    {
        
hMTSpawnDelay[i].RemoveChangeHook(OnMTCVarsChanged);
    }
    
    for (
int i 05i++)
    {
        
hMTHealthCoop[i].RemoveChangeHook(OnMTCVarsChanged);
        
hMTCountCoop[i].RemoveChangeHook(OnMTCVarsChanged);
        
        
hMTHealthVersus[i].RemoveChangeHook(OnMTCVarsChanged);
        
hMTCountVersus[i].RemoveChangeHook(OnMTCVarsChanged);
        
        if (
== || == || == 4)
        {
            
hMTSameSpawn[(== 4) ? i].RemoveChangeHook(OnMTCVarsChanged);
        }
    }
    
    
UnhookEvent("round_start"OnRoundEvents);
    
UnhookEvent("round_end"OnRoundEvents);
    
    
UnhookEvent("finale_start"OnFinaleEvents);
    
UnhookEvent("finale_escape_start"OnFinaleEvents);
    
UnhookEvent("finale_vehicle_leaving"OnFinaleEvents);
    
    
UnhookEvent("tank_frustrated"OnTankFrustrated);
    
UnhookEvent("player_death"OnPlayerDeathEventHookMode_Pre);
    
UnhookEvent("tank_spawn"OnTankSpawn);
}

public 
void OnRoundEvents(Event event, const char[] namebool dontBroadcast)
{
    if (!
bMTOn)
    {
        return;
    }
    
    if (
StrEqual(name"round_start"))
    {
        
bRoundBegan true;
        
bRoundFinished false;
        
        
msBase MS_REGULAR;
    }
    else if (
StrEqual(name"round_end"))
    {
        
bRoundBegan false;
        
bRoundFinished true;
        
        
msBase MS_ROUNDEND;
    }
    
LaunchMTParameters();
    
    
iTankCount 0;
    
iFinaleWave 0;
    
    
bFirstSpawned false;
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
iFrustration[i] = 0;
            
            
bIsTank[i] = false;
            
bFrustrated[i] = false;
        }
    }
}

public 
void OnFinaleEvents(Event event, const char[] namebool dontBroadcast)
{
    if (!
bMTOn)
    {
        return;
    }
    
    if (
StrEqual(name"finale_start") || StrEqual(name"finale_vehicle_leaving"))
    {
        
iFinaleWave 0;
    }
    
    if (
StrEqual(name"finale_start"))
    {
        
msBase MS_FINALE;
    }
    else if (
StrEqual(name"finale_escape_start"))
    {
        
msBase MS_ESCAPE;
    }
    else if (
StrEqual(name"finale_vehicle_leaving"))
    {
        
msBase MS_LEAVING;
    }
    
LaunchMTParameters();
}

public 
void OnTankFrustrated(Event event, const char[] namebool dontBroadcast)
{
    if (!
bMTOn)
    {
        return;
    }
    
    
int tank GetClientOfUserId(event.GetInt("userid"));
    if (!
IsTank(tank))
    {
        return;
    }
    
    
bFrustrated[tank] = true;
    
    if (
bMTAnnounce)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && GetClientTeam(i) == && !IsFakeClient(i))
            {
                
PrintToChat(i"\x04[MT]\x01 %N Lost Control!"tank);
            }
        }
    }
}

public 
Action OnPlayerDeath(Event event, const char[] namebool dontBroadcast)
{
    if (!
bMTOn)
    {
        return 
Plugin_Continue;
    }
    
    
int died GetClientOfUserId(event.GetInt("userid"));
    if (!
IsTank(died))
    {
        return 
Plugin_Continue;
    }
    
    if (
iTankCount 0)
    {
        
iTankCount -= 1;
        if (
iTankCount <= 0)
        {
            
bFirstSpawned false;
        }
    }
    
    if (
bFrustrated[died])
    {
        
bFrustrated[died] = false;
    }
    
bIsTank[died] = false;
    
    return 
Plugin_Continue;
}

public 
void OnTankSpawn(Event event, const char[] namebool dontBroadcast)
{
    if (!
bMTOn)
    {
        return;
    }
    
    
int tank GetClientOfUserId(event.GetInt("userid"));
    if (!
tank)
    {
        return;
    }
    
    if (!
bIsTank[tank])
    {
        
bIsTank[tank] = true;
        
        if (!
bFirstSpawned && msBase == MS_FINALE)
        {
            
bFirstSpawned true;
            
            
iFinaleWave += 1;
            
LaunchMTParameters();
        }
        
        
SetEntProp(tankProp_Send"m_iHealth"iTankHP1);
        
SetEntProp(tankProp_Send"m_iMaxHealth"iTankHP1);
        
        if ((
msBase == MS_ESCAPE) ? bMTSameSpawn[2] : ((msBase != MS_FINALE) ? bMTSameSpawn[1] : bMTSameSpawn[0]))
        {
            if (
iTankCount <= 0)
            {
                
GetEntPropVector(tankProp_Send"m_vecOrigin"fTankPos);
            }
            else
            {
                
TeleportEntity(tankfTankPosNULL_VECTORNULL_VECTOR);
            }
        }
        
        
iTankCount += 1;
        if (
iTankCount iMaxTankCount)
        {
            
ChangeInfectedLimits(iMaxZombies iMaxTankCount);
            
CreateTimer((msBase != MS_ESCAPE) ? fMTSpawnDelay[0] : fMTSpawnDelay[1], SpawnMoreTank);
        }
        else
        {
            
ChangeInfectedLimits(iMaxZombies);
        }
        
        if (
bMTAnnounce && msBase != MS_ROUNDEND)
        {
            for (
int i 1<= MaxClientsi++)
            {
                if (
IsClientInGame(i) && !IsFakeClient(i))
                {
                    if (
GetClientTeam(i) == 3)
                    {
                        if (
IsFakeClient(tank))
                        {
                            
PrintToChat(i"\x04[MT]\x01 New Tank Spawning (%i HP) [AI]"iTankHP);
                        }
                        else
                        {
                            
PrintToChat(i"\x04[MT]\x01 New Tank Spawning (%i HP) [%N]"iTankHPtank);
                        }
                    }
                    else
                    {
                        
PrintToChat(i"\x04[MT]\x01 New Tank Spawning (%i HP)"iTankHP);
                    }
                }
            }
        }
    }
    else
    {
        if (
bFrustrated[tank])
        {
            
bFrustrated[tank] = false;
        }
        
SetEntProp(tankProp_Send"m_iMaxHealth"iTankHP1);
    }
    
    if (!
IsFakeClient(tank))
    {
        
CreateTimer(10.0CheckFrustrationGetClientUserId(tank));
    }
    
    if (
bMTDisplay)
    {
        
pMTList = new Panel();
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && GetClientTeam(i) == && GetEntProp(iProp_Send"m_zombieClass") == && IsPlayerAlive(i) && !GetEntProp(iProp_Send"m_isIncapacitated"1))
            {
                
char sText[128];
                if (
IsPlayerBurning(i))
                {
                    
Format(sTextsizeof(sText), "%N: %i HP (FIRE)"iGetEntProp(iProp_Send"m_iHealth"));
                }
                else
                {
                    
Format(sTextsizeof(sText), "%N: %i HP, Control: %iï¼…"iGetEntProp(iProp_Send"m_iHealth"), 100 GetEntProp(iProp_Send"m_frustration"));
                }
                
pMTList.DrawText(sText);
            }
        }
        
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && GetClientTeam(i) != && !IsFakeClient(i))
            {
                
pMTList.Send(iMTListHandler1);
            }
        }
        
delete pMTList;
    }
}

public 
Action SpawnMoreTank(Handle timer)
{
    if (!
bMTOn || !bRoundBegan || bRoundFinished)
    {
        return 
Plugin_Stop;
    }
    
    
int iCommandExecuter 0;
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
iCommandExecuter i;
            break;
        }
    }
    if (
iCommandExecuter == 0)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i))
            {
                
iCommandExecuter i;
                break;
            }
        }
    }
    
    
int iFlags GetCommandFlags("z_spawn_old");
    
SetCommandFlags("z_spawn_old"iFlags & ~FCVAR_CHEAT);
    
FakeClientCommand(iCommandExecuter"z_spawn_old tank auto");
    
SetCommandFlags("z_spawn_old"iFlags);
    
    return 
Plugin_Stop;
}

public 
Action CheckFrustration(Handle timerany userid)
{
    
int client GetClientOfUserId(userid);
    if (!
IsTank(client) || !IsPlayerAlive(client) || IsFakeClient(client))
    {
        return 
Plugin_Stop;
    }
    
    
int iFrustrationProgress GetEntProp(clientProp_Send"m_frustration");
    if (
iFrustrationProgress >= 95)
    {
        if (!
IsPlayerBurning(client))
        {
            
iFrustration[client] += 1;
            if (
iFrustration[client] < 2)
            {
                
SetEntProp(clientProp_Send"m_frustration"0);
                
CreateTimer(0.1CheckFrustrationGetClientUserId(client));
                
                for (
int i 1<= MaxClientsi++)
                {    
                    if (
IsClientInGame(i) && GetClientTeam(i) == && !IsFakeClient(i))
                    {
                        
PrintToChat(i"\x04[MT]\x01 %N Lost First Tank Control!"client);
                    }
                }
            }
        }
        else
        {
            
CreateTimer(0.1CheckFrustrationGetClientUserId(client));
        }
    }
    else
    {
        
CreateTimer(0.1 + (95 iFrustrationProgress) * 0.1CheckFrustrationGetClientUserId(client));
    }
    return 
Plugin_Stop;
}

public 
int MTListHandler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_End)
    {
        if (
bMTDisplay)
        {
            
pMTList = new Panel();
            for (
int i 1<= MaxClientsi++)
            {
                if (
IsClientInGame(i) && GetClientTeam(i) == && GetEntProp(iProp_Send"m_zombieClass") == && IsPlayerAlive(i) && !GetEntProp(iProp_Send"m_isIncapacitated"1))
                {
                    
char sText[128];
                    if (
IsPlayerBurning(i))
                    {
                        
Format(sTextsizeof(sText), "%N: %i HP (FIRE)"iGetEntProp(iProp_Send"m_iHealth"));
                    }
                    else
                    {
                        
Format(sTextsizeof(sText), "%N: %i HP, Control: %iï¼…"iGetEntProp(iProp_Send"m_iHealth"), 100 GetEntProp(iProp_Send"m_frustration"));
                    }
                    
pMTList.DrawText(sText);
                }
            }
            
            for (
int i 1<= MaxClientsi++)
            {
                if (
IsClientInGame(i) && GetClientTeam(i) != && !IsFakeClient(i))
                {
                    
pMTList.Send(iMTListHandler1);
                }
            }
            
delete pMTList;
        }
    }
}

GameModeStatus GetGameModeInfo()
{
    
char sGameMode[16];
    
hGameMode.GetString(sGameModesizeof(sGameMode));
    if (
StrEqual(sGameMode"coop"false) || StrEqual(sGameMode"realism"false))
    {
        return 
GMS_COOP;
    }
    else if (
StrEqual(sGameMode"versus"false) || StrEqual(sGameMode"teamversus"false))
    {
        return 
GMS_VERSUS;
    }
    else if (
StrEqual(sGameMode"survival"false))
    {
        return 
GMS_SURVIVAL;
    }
    else if (
StrEqual(sGameMode"scavenge"false) || StrEqual(sGameMode"teamscavenge"false))
    {
        return 
GMS_SCAVENGE;
    }
    else
    {
        return 
GMS_UNKNOWN;
    }
}

void LaunchMTParameters()
{
    switch (
gmsBase)
    {
        case 
GMS_COOP:
        {
            switch (
msBase)
            {
                case 
MS_REGULAR:
                {
                    
iTankHP = (L4D_IsMissionFinalMap()) ? iMTHealthCoop[1] : iMTHealthCoop[0];
                    
iMaxTankCount = (L4D_IsMissionFinalMap()) ? iMTCountCoop[1] : iMTCountCoop[0];
                }
                case 
MS_FINALE:
                {
                    
iTankHP = (iFinaleWave == 2) ? iMTHealthCoop[3] : iMTHealthCoop[2];
                    
iMaxTankCount = (iFinaleWave == 2) ? iMTCountCoop[3] : iMTCountCoop[2];
                }
                case 
MS_ESCAPE:
                {
                    
iTankHP iMTHealthCoop[4];
                    
iMaxTankCount iMTCountCoop[4];
                }
                case 
MS_LEAVINGiMaxTankCount 0;
                case 
MS_ROUNDENDiMaxTankCount 0;
            }
        }
        case 
GMS_VERSUS
        {
            switch (
msBase)
            {
                case 
MS_REGULAR:
                {
                    
iTankHP = (L4D_IsMissionFinalMap()) ? iMTHealthVersus[1] : iMTHealthVersus[0];     
                    
iMaxTankCount = (L4D_IsMissionFinalMap()) ? iMTCountVersus[1] : iMTCountVersus[0];
                }
                case 
MS_FINALE:
                {
                    
iTankHP = (iFinaleWave == 2) ? iMTHealthVersus[3] : iMTHealthVersus[2];
                    
iMaxTankCount = (iFinaleWave == 2) ? iMTCountVersus[3] : iMTCountVersus[2];
                }
                case 
MS_ESCAPE:
                {
                    
iTankHP iMTHealthVersus[4];
                    
iMaxTankCount iMTCountVersus[4];
                }
                case 
MS_LEAVINGiMaxTankCount 0;
                case 
MS_ROUNDENDiMaxTankCount 0;
            }
        }
        case 
GMS_SURVIVAL
        {
            
iTankHP iMTHealthSurvival;
            
iMaxTankCount iMTCountSurvival;
        }
        case 
GMS_SCAVENGE
        {
            
iTankHP iMTHealthScavenge;
            
iMaxTankCount iMTCountScavenge;
        }
        case 
GMS_UNKNOWN
        {
            
iTankHP 12500;
            
iMaxTankCount 1;
        }
    }
}

void ChangeInfectedLimits(int iValue)
{
    if (
FindConVar("super_versus_version") == null)
    {
        
FindConVar("z_max_player_zombies").SetInt(iValuetruefalse);
    }
    else
    {
        
int iFlags FindConVar("super_versus_infected_limit").Flags;
        
FindConVar("super_versus_infected_limit").Flags iFlags & ~FCVAR_NOTIFY;
        
FindConVar("super_versus_infected_limit").SetInt(iValue);
        
FindConVar("super_versus_infected_limit").Flags iFlags;
    }
}

bool IsTank(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == && GetEntProp(clientProp_Send"m_zombieClass") == 8);
}

bool IsPlayerBurning(int client)
{
    
float fBurning GetEntDataFloat(clientFindSendPropInfo("CTerrorPlayer""m_burnPercent"));
    return (
fBurning 0.0) ? true false;

rtokuda is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 07-28-2020 , 01:16   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #7

Quote:
Originally Posted by rtokuda View Post
I replaced "<left4downtown>" with "<l4d hooks>" and compiled, it doesn't work properly on L4d1 maps:
1. not #include <dhooks>, it's
PHP Code:
#include <left4dhooks> 
2. I can rewrite code to work properly, but you have to remove left4downtown and install l4dhooks on your server.
__________________

Last edited by HarryPotter; 07-28-2020 at 01:17.
HarryPotter is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 07-28-2020 , 08:28   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #8

Quote:
Originally Posted by fbef0102 View Post
1. not #include <dhooks>, it's
PHP Code:
#include <left4dhooks> 
2. I can rewrite code to work properly, but you have to remove left4downtown and install l4dhooks on your server.

Okay, I already removed left4downtown and installed l4dhook
rtokuda is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 07-28-2020 , 23:41   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #9

Quote:
Originally Posted by rtokuda View Post
Okay, I already removed left4downtown and installed l4dhook
done. put multitanks_a.txt in sourcemod/gamedata

try
PHP Code:
multitanks_count_coop_1stwave "2"
multitanks_count_coop_2ndwave "3"
multitanks_count_coop_escape "4"
multitanks_count_coop_finale "1" 
Attached Files
File Type: txt multitanks_a.txt (301 Bytes, 111 views)
File Type: sp Get Plugin or Get Source (multitanks_a-l4d2.sp - 117 views - 23.5 KB)
__________________
HarryPotter is offline
rtokuda
Senior Member
Join Date: Dec 2019
Old 07-30-2020 , 08:26   Re: [L4D2] How I can add two tanks on the final waves ?
Reply With Quote #10

Quote:
Originally Posted by fbef0102 View Post
done. put multitanks_a.txt in sourcemod/gamedata

try
PHP Code:
multitanks_count_coop_1stwave "2"
multitanks_count_coop_2ndwave "3"
multitanks_count_coop_escape "4"
multitanks_count_coop_finale "1" 

I tested it on all official Steam maps and it worked. I made the configuration changes using the CFG file generated by the plugin. Thank you very much for your work!
rtokuda is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode