Skip to content

Commit

Permalink
Prevent attempts to change class as special infected
Browse files Browse the repository at this point in the history
  • Loading branch information
FortyTwoFortyTwo committed Dec 15, 2023
1 parent 6a6e063 commit 5823c1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions addons/sourcemod/scripting/szf/console.sp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public Action Console_JoinClass(int iClient, const char[] sCommand, int iArgs)

if (IsZombie(iClient))
{
if (g_nInfected[iClient] != Infected_None)
return Plugin_Handled;

//Check if the player selected a valid zombie class
if (IsValidZombieClass(TF2_GetClass(sArg)))
{
Expand Down
13 changes: 5 additions & 8 deletions addons/sourcemod/scripting/szf/infected.sp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ static int g_iTankHealthSubtract[MAXPLAYERS];

public void Infected_OnTankSpawn(int iClient)
{
if (g_flTankLifetime[iClient] < GetGameTime() - 0.5) //Prevent multiple announces from spawnroom
{
//TAAAAANK
CPrintToChatAll("%t", "Tank_Spawn", "{red}");
Sound_PlayInfectedVoToAll(Infected_Tank, SoundVo_Fire);

g_iTanksSpawned++;
}
//TAAAAANK
CPrintToChatAll("%t", "Tank_Spawn", "{red}");
Sound_PlayInfectedVoToAll(Infected_Tank, SoundVo_Fire);

g_iTanksSpawned++;

g_hTimerTank[iClient] = CreateTimer(1.0, Infected_TankTimer, GetClientSerial(iClient), TIMER_REPEAT);
g_flTankLifetime[iClient] = GetGameTime();
Expand Down

0 comments on commit 5823c1f

Please sign in to comment.