Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Psykotikism committed Aug 17, 2018
1 parent 486f950 commit 4b1057b
Show file tree
Hide file tree
Showing 57 changed files with 545 additions and 489 deletions.
173 changes: 112 additions & 61 deletions addons/sourcemod/scripting/include/super_tanks++.inc

Large diffs are not rendered by default.

44 changes: 33 additions & 11 deletions addons/sourcemod/scripting/super_tanks++/st_absorb.sp
Expand Up @@ -15,8 +15,16 @@ public Plugin myinfo =
bool g_bAbsorb[MAXPLAYERS + 1];
bool g_bLateLoad;
bool g_bTankConfig[ST_MAXTYPES + 1];
float g_flAbsorbBulletDamage[ST_MAXTYPES + 1];
float g_flAbsorbBulletDamage2[ST_MAXTYPES + 1];
float g_flAbsorbDuration[ST_MAXTYPES + 1];
float g_flAbsorbDuration2[ST_MAXTYPES + 1];
float g_flAbsorbExplosiveDamage[ST_MAXTYPES + 1];
float g_flAbsorbExplosiveDamage2[ST_MAXTYPES + 1];
float g_flAbsorbFireDamage[ST_MAXTYPES + 1];
float g_flAbsorbFireDamage2[ST_MAXTYPES + 1];
float g_flAbsorbMeleeDamage[ST_MAXTYPES + 1];
float g_flAbsorbMeleeDamage2[ST_MAXTYPES + 1];
int g_iAbsorbAbility[ST_MAXTYPES + 1];
int g_iAbsorbAbility2[ST_MAXTYPES + 1];
int g_iAbsorbChance[ST_MAXTYPES + 1];
Expand All @@ -25,9 +33,9 @@ int g_iAbsorbChance2[ST_MAXTYPES + 1];
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if (evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2)
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Absorb Ability only supports Left 4 Dead 1 & 2.");
strcopy(error, err_max, "[ST++] Absorb Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
Expand Down Expand Up @@ -64,12 +72,6 @@ public void OnClientPostAdminCheck(int client)
g_bAbsorb[client] = false;
}

public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
g_bAbsorb[client] = false;
}

public void OnMapEnd()
{
for (int iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
Expand Down Expand Up @@ -101,13 +103,25 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam
{
if (ST_TankAllowed(victim) && IsPlayerAlive(victim) && g_bAbsorb[victim])
{
if (damagetype & DMG_BULLET || damagetype & DMG_BLAST || damagetype & DMG_BLAST_SURFACE || damagetype & DMG_AIRBOAT || damagetype & DMG_PLASMA)
float flAbsorbBulletDamage = !g_bTankConfig[ST_TankType(victim)] ? g_flAbsorbBulletDamage[ST_TankType(victim)] : g_flAbsorbBulletDamage2[ST_TankType(victim)];
float flAbsorbExplosiveDamage = !g_bTankConfig[ST_TankType(victim)] ? g_flAbsorbExplosiveDamage[ST_TankType(victim)] : g_flAbsorbExplosiveDamage2[ST_TankType(victim)];
float flAbsorbFireDamage = !g_bTankConfig[ST_TankType(victim)] ? g_flAbsorbFireDamage[ST_TankType(victim)] : g_flAbsorbFireDamage2[ST_TankType(victim)];
float flAbsorbMeleeDamage = !g_bTankConfig[ST_TankType(victim)] ? g_flAbsorbMeleeDamage[ST_TankType(victim)] : g_flAbsorbMeleeDamage2[ST_TankType(victim)];
if (damagetype & DMG_BULLET)
{
damage = damage / flAbsorbBulletDamage;
}
else if (damagetype & DMG_BLAST || damagetype & DMG_BLAST_SURFACE || damagetype & DMG_AIRBOAT || damagetype & DMG_PLASMA)
{
damage = damage / flAbsorbExplosiveDamage;
}
else if (damagetype & DMG_BURN)
{
damage = damage / 10;
damage = damage / flAbsorbFireDamage;
}
else if (damagetype & DMG_SLASH || damagetype & DMG_CLUB)
{
damage = damage / 1000;
damage = damage / flAbsorbMeleeDamage;
}
return Plugin_Changed;
}
Expand All @@ -128,10 +142,18 @@ public void ST_Configs(char[] savepath, int limit, bool main)
main ? (g_bTankConfig[iIndex] = false) : (g_bTankConfig[iIndex] = true);
main ? (g_iAbsorbAbility[iIndex] = kvSuperTanks.GetNum("Absorb Ability/Ability Enabled", 0)) : (g_iAbsorbAbility2[iIndex] = kvSuperTanks.GetNum("Absorb Ability/Ability Enabled", g_iAbsorbAbility[iIndex]));
main ? (g_iAbsorbAbility[iIndex] = iSetCellLimit(g_iAbsorbAbility[iIndex], 0, 1)) : (g_iAbsorbAbility2[iIndex] = iSetCellLimit(g_iAbsorbAbility2[iIndex], 0, 1));
main ? (g_flAbsorbBulletDamage[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Bullet Damage", 20.0)) : (g_flAbsorbBulletDamage2[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Bullet Damage", g_flAbsorbBulletDamage[iIndex]));
main ? (g_flAbsorbBulletDamage[iIndex] = flSetFloatLimit(g_flAbsorbBulletDamage[iIndex], 0.1, 9999999999.0)) : (g_flAbsorbBulletDamage2[iIndex] = flSetFloatLimit(g_flAbsorbBulletDamage2[iIndex], 0.1, 9999999999.0));
main ? (g_iAbsorbChance[iIndex] = kvSuperTanks.GetNum("Absorb Ability/Absorb Chance", 4)) : (g_iAbsorbChance2[iIndex] = kvSuperTanks.GetNum("Absorb Ability/Absorb Chance", g_iAbsorbChance[iIndex]));
main ? (g_iAbsorbChance[iIndex] = iSetCellLimit(g_iAbsorbChance[iIndex], 1, 9999999999)) : (g_iAbsorbChance2[iIndex] = iSetCellLimit(g_iAbsorbChance2[iIndex], 1, 9999999999));
main ? (g_flAbsorbDuration[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Duration", 5.0)) : (g_flAbsorbDuration2[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Duration", g_flAbsorbDuration[iIndex]));
main ? (g_flAbsorbDuration[iIndex] = flSetFloatLimit(g_flAbsorbDuration[iIndex], 0.1, 9999999999.0)) : (g_flAbsorbDuration2[iIndex] = flSetFloatLimit(g_flAbsorbDuration2[iIndex], 0.1, 9999999999.0));
main ? (g_flAbsorbExplosiveDamage[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Explosive Damage", 20.0)) : (g_flAbsorbExplosiveDamage2[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Explosive Damage", g_flAbsorbExplosiveDamage[iIndex]));
main ? (g_flAbsorbExplosiveDamage[iIndex] = flSetFloatLimit(g_flAbsorbExplosiveDamage[iIndex], 0.1, 9999999999.0)) : (g_flAbsorbExplosiveDamage2[iIndex] = flSetFloatLimit(g_flAbsorbExplosiveDamage2[iIndex], 0.1, 9999999999.0));
main ? (g_flAbsorbFireDamage[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Fire Damage", 200.0)) : (g_flAbsorbFireDamage2[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Fire Damage", g_flAbsorbFireDamage[iIndex]));
main ? (g_flAbsorbFireDamage[iIndex] = flSetFloatLimit(g_flAbsorbFireDamage[iIndex], 0.1, 9999999999.0)) : (g_flAbsorbFireDamage2[iIndex] = flSetFloatLimit(g_flAbsorbFireDamage2[iIndex], 0.1, 9999999999.0));
main ? (g_flAbsorbMeleeDamage[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Melee Damage", 200.0)) : (g_flAbsorbMeleeDamage2[iIndex] = kvSuperTanks.GetFloat("Absorb Ability/Absorb Melee Damage", g_flAbsorbMeleeDamage[iIndex]));
main ? (g_flAbsorbMeleeDamage[iIndex] = flSetFloatLimit(g_flAbsorbMeleeDamage[iIndex], 0.1, 9999999999.0)) : (g_flAbsorbMeleeDamage2[iIndex] = flSetFloatLimit(g_flAbsorbMeleeDamage2[iIndex], 0.1, 9999999999.0));
kvSuperTanks.Rewind();
}
}
Expand Down
9 changes: 2 additions & 7 deletions addons/sourcemod/scripting/super_tanks++/st_acid.sp
Expand Up @@ -32,9 +32,9 @@ int g_iAcidRock2[ST_MAXTYPES + 1];
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if (evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2)
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Acid Ability only supports Left 4 Dead 1 & 2.");
strcopy(error, err_max, "[ST++] Acid Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
Expand Down Expand Up @@ -97,11 +97,6 @@ public void OnClientPostAdminCheck(int client)
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

void vLateLoad(bool late)
{
if (late)
Expand Down
9 changes: 2 additions & 7 deletions addons/sourcemod/scripting/super_tanks++/st_ammo.sp
Expand Up @@ -30,9 +30,9 @@ int g_iAmmoRangeChance2[ST_MAXTYPES + 1];
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if (evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2)
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Ammo Ability only supports Left 4 Dead 1 & 2.");
strcopy(error, err_max, "[ST++] Ammo Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
Expand Down Expand Up @@ -61,11 +61,6 @@ public void OnClientPostAdminCheck(int client)
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

void vLateLoad(bool late)
{
if (late)
Expand Down
10 changes: 2 additions & 8 deletions addons/sourcemod/scripting/super_tanks++/st_blind.sp
Expand Up @@ -34,9 +34,9 @@ UserMsg g_umFadeUserMsgId;
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if (evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2)
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Blind Ability only supports Left 4 Dead 1 & 2.");
strcopy(error, err_max, "[ST++] Blind Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
Expand Down Expand Up @@ -78,12 +78,6 @@ public void OnClientPostAdminCheck(int client)
g_bBlind[client] = false;
}

public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
g_bBlind[client] = false;
}

public void OnMapEnd()
{
for (int iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
Expand Down
9 changes: 2 additions & 7 deletions addons/sourcemod/scripting/super_tanks++/st_bomb.sp
Expand Up @@ -30,9 +30,9 @@ int g_iBombRock2[ST_MAXTYPES + 1];
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if (evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2)
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Bomb Ability only supports Left 4 Dead 1 & 2.");
strcopy(error, err_max, "[ST++] Bomb Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
Expand Down Expand Up @@ -62,11 +62,6 @@ public void OnClientPostAdminCheck(int client)
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

void vLateLoad(bool late)
{
if (late)
Expand Down
10 changes: 2 additions & 8 deletions addons/sourcemod/scripting/super_tanks++/st_bury.sp
Expand Up @@ -34,9 +34,9 @@ int g_iBuryRangeChance2[ST_MAXTYPES + 1];
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if (evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2)
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Bury Ability only supports Left 4 Dead 1 & 2.");
strcopy(error, err_max, "[ST++] Bury Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
Expand Down Expand Up @@ -85,12 +85,6 @@ public void OnClientPostAdminCheck(int client)
g_bBury[client] = false;
}

public void OnClientDisconnect(int client)
{
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
g_bBury[client] = false;
}

public void OnMapEnd()
{
for (int iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
Expand Down
185 changes: 185 additions & 0 deletions addons/sourcemod/scripting/super_tanks++/st_cancer.sp
@@ -0,0 +1,185 @@
// Super Tanks++: Cancer Ability
#pragma semicolon 1
#pragma newdecls required
#include <super_tanks++>

public Plugin myinfo =
{
name = "[ST++] Cancer Ability",
author = ST_AUTHOR,
description = ST_DESCRIPTION,
version = ST_VERSION,
url = ST_URL
};

bool g_bLateLoad;
bool g_bTankConfig[ST_MAXTYPES + 1];
char g_sTankColors[ST_MAXTYPES + 1][28];
char g_sTankColors2[ST_MAXTYPES + 1][28];
ConVar g_cvSTFindConVar;
float g_flCancerRange[ST_MAXTYPES + 1];
float g_flCancerRange2[ST_MAXTYPES + 1];
int g_iCancerAbility[ST_MAXTYPES + 1];
int g_iCancerAbility2[ST_MAXTYPES + 1];
int g_iCancerChance[ST_MAXTYPES + 1];
int g_iCancerChance2[ST_MAXTYPES + 1];
int g_iCancerHit[ST_MAXTYPES + 1];
int g_iCancerHit2[ST_MAXTYPES + 1];
int g_iCancerRangeChance[ST_MAXTYPES + 1];
int g_iCancerRangeChance2[ST_MAXTYPES + 1];

public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
EngineVersion evEngine = GetEngineVersion();
if ((evEngine != Engine_Left4Dead && evEngine != Engine_Left4Dead2) || !IsDedicatedServer())
{
strcopy(error, err_max, "[ST++] Cancer Ability only supports Left 4 Dead 1 & 2 Dedicated Servers.");
return APLRes_SilentFailure;
}
g_bLateLoad = late;
return APLRes_Success;
}

public void OnAllPluginsLoaded()
{
if (!LibraryExists("super_tanks++"))
{
SetFailState("No Super Tanks++ library found.");
}
}

public void OnPluginStart()
{
g_cvSTFindConVar = FindConVar("survivor_max_incapacitated_count");
}

public void OnMapStart()
{
if (g_bLateLoad)
{
vLateLoad(true);
g_bLateLoad = false;
}
}

public void OnClientPostAdminCheck(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}

void vLateLoad(bool late)
{
if (late)
{
for (int iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
{
if (bIsValidClient(iPlayer))
{
SDKHook(iPlayer, SDKHook_OnTakeDamage, OnTakeDamage);
}
}
}
}

public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
if (ST_PluginEnabled() && damage > 0.0)
{
char sClassname[32];
GetEntityClassname(inflictor, sClassname, sizeof(sClassname));
if (ST_TankAllowed(attacker) && IsPlayerAlive(attacker) && bIsSurvivor(victim))
{
if (strcmp(sClassname, "weapon_tank_claw") == 0 || strcmp(sClassname, "tank_rock") == 0)
{
int iCancerChance = !g_bTankConfig[ST_TankType(attacker)] ? g_iCancerChance[ST_TankType(attacker)] : g_iCancerChance2[ST_TankType(attacker)];
int iCancerHit = !g_bTankConfig[ST_TankType(attacker)] ? g_iCancerHit[ST_TankType(attacker)] : g_iCancerHit2[ST_TankType(attacker)];
vCancerHit(victim, attacker, iCancerChance, iCancerHit);
}
}
else if (ST_TankAllowed(victim) && IsPlayerAlive(victim) && bIsSurvivor(attacker))
{
if (strcmp(sClassname, "weapon_melee") == 0)
{
int iCancerChance = !g_bTankConfig[ST_TankType(victim)] ? g_iCancerChance[ST_TankType(victim)] : g_iCancerChance2[ST_TankType(victim)];
int iCancerHit = !g_bTankConfig[ST_TankType(victim)] ? g_iCancerHit[ST_TankType(victim)] : g_iCancerHit2[ST_TankType(victim)];
vCancerHit(attacker, victim, iCancerChance, iCancerHit);
}
}
}
return Plugin_Continue;
}

public void ST_Configs(char[] savepath, int limit, bool main)
{
KeyValues kvSuperTanks = new KeyValues("Super Tanks++");
kvSuperTanks.ImportFromFile(savepath);
for (int iIndex = 1; iIndex <= limit; iIndex++)
{
char sName[MAX_NAME_LENGTH + 1];
Format(sName, sizeof(sName), "Tank %d", iIndex);
if (kvSuperTanks.JumpToKey(sName))
{
main ? (g_bTankConfig[iIndex] = false) : (g_bTankConfig[iIndex] = true);
main ? (kvSuperTanks.GetString("General/Skin-Glow Colors", g_sTankColors[iIndex], sizeof(g_sTankColors[]), "255,255,255,255|255,255,255")) : (kvSuperTanks.GetString("General/Skin-Glow Colors", g_sTankColors2[iIndex], sizeof(g_sTankColors2[]), g_sTankColors[iIndex]));
main ? (g_iCancerAbility[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Ability Enabled", 0)) : (g_iCancerAbility2[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Ability Enabled", g_iCancerAbility[iIndex]));
main ? (g_iCancerAbility[iIndex] = iSetCellLimit(g_iCancerAbility[iIndex], 0, 1)) : (g_iCancerAbility2[iIndex] = iSetCellLimit(g_iCancerAbility2[iIndex], 0, 1));
main ? (g_iCancerChance[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Cancer Chance", 4)) : (g_iCancerChance2[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Cancer Chance", g_iCancerChance[iIndex]));
main ? (g_iCancerChance[iIndex] = iSetCellLimit(g_iCancerChance[iIndex], 1, 9999999999)) : (g_iCancerChance2[iIndex] = iSetCellLimit(g_iCancerChance2[iIndex], 1, 9999999999));
main ? (g_iCancerHit[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Cancer Hit", 0)) : (g_iCancerHit2[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Cancer Hit", g_iCancerHit[iIndex]));
main ? (g_iCancerHit[iIndex] = iSetCellLimit(g_iCancerHit[iIndex], 0, 1)) : (g_iCancerHit2[iIndex] = iSetCellLimit(g_iCancerHit2[iIndex], 0, 1));
main ? (g_flCancerRange[iIndex] = kvSuperTanks.GetFloat("Cancer Ability/Cancer Range", 150.0)) : (g_flCancerRange2[iIndex] = kvSuperTanks.GetFloat("Cancer Ability/Cancer Range", g_flCancerRange[iIndex]));
main ? (g_flCancerRange[iIndex] = flSetFloatLimit(g_flCancerRange[iIndex], 1.0, 9999999999.0)) : (g_flCancerRange2[iIndex] = flSetFloatLimit(g_flCancerRange2[iIndex], 1.0, 9999999999.0));
main ? (g_iCancerRangeChance[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Cancer Range Chance", 16)) : (g_iCancerRangeChance2[iIndex] = kvSuperTanks.GetNum("Cancer Ability/Cancer Range Chance", g_iCancerRangeChance[iIndex]));
main ? (g_iCancerRangeChance[iIndex] = iSetCellLimit(g_iCancerRangeChance[iIndex], 1, 9999999999)) : (g_iCancerRangeChance2[iIndex] = iSetCellLimit(g_iCancerRangeChance2[iIndex], 1, 9999999999));
kvSuperTanks.Rewind();
}
}
delete kvSuperTanks;
}

public void ST_Ability(int client)
{
if (ST_TankAllowed(client) && IsPlayerAlive(client))
{
int iCancerAbility = !g_bTankConfig[ST_TankType(client)] ? g_iCancerAbility[ST_TankType(client)] : g_iCancerAbility2[ST_TankType(client)];
int iCancerRangeChance = !g_bTankConfig[ST_TankType(client)] ? g_iCancerChance[ST_TankType(client)] : g_iCancerChance2[ST_TankType(client)];
float flCancerRange = !g_bTankConfig[ST_TankType(client)] ? g_flCancerRange[ST_TankType(client)] : g_flCancerRange2[ST_TankType(client)];
float flTankPos[3];
GetClientAbsOrigin(client, flTankPos);
for (int iSurvivor = 1; iSurvivor <= MaxClients; iSurvivor++)
{
if (bIsSurvivor(iSurvivor))
{
float flSurvivorPos[3];
GetClientAbsOrigin(iSurvivor, flSurvivorPos);
float flDistance = GetVectorDistance(flTankPos, flSurvivorPos);
if (flDistance <= flCancerRange)
{
vCancerHit(iSurvivor, client, iCancerRangeChance, iCancerAbility);
}
}
}
}
}

void vCancerHit(int client, int owner, int chance, int enabled)
{
if (enabled == 1 && GetRandomInt(1, chance) == 1 && bIsSurvivor(client))
{
char sSet[2][16];
char sTankColors[28];
sTankColors = !g_bTankConfig[ST_TankType(owner)] ? g_sTankColors[ST_TankType(owner)] : g_sTankColors2[ST_TankType(owner)];
TrimString(sTankColors);
ExplodeString(sTankColors, "|", sSet, sizeof(sSet), sizeof(sSet[]));
char sRGB[4][4];
ExplodeString(sSet[0], ",", sRGB, sizeof(sRGB), sizeof(sRGB[]));
TrimString(sRGB[0]);
int iRed = (sRGB[0][0] != '\0') ? StringToInt(sRGB[0]) : 255;
TrimString(sRGB[1]);
int iGreen = (sRGB[1][0] != '\0') ? StringToInt(sRGB[1]) : 255;
TrimString(sRGB[2]);
int iBlue = (sRGB[2][0] != '\0') ? StringToInt(sRGB[2]) : 255;
SetEntProp(client, Prop_Send, "m_currentReviveCount", g_cvSTFindConVar.IntValue);
vFade(client, 800, 300, iRed, iGreen, iBlue);
}
}

0 comments on commit 4b1057b

Please sign in to comment.