Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- SourcePawn is Copyright (C) 2006-2008 AlliedModders LLC. All rights reserved.
- SourceMod is Copyright (C) 2006-2008 AlliedModders LLC. All rights reserved.
- Pawn and SMALL are Copyright (C) 1997-2008 ITB CompuPhase.
- Source is Copyright (C) Valve Corporation.
- All trademarks are property of their respective owners.
- This program is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation, either version 3 of the License, or (at your
- option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #include <sourcemod>
- #include <multicolors>
- #include <sdkhooks>
- #include <sdktools>
- #pragma semicolon 1
- #pragma newdecls required
- // Stats Buffer
- int g_ibTotalAssists[MAXPLAYERS+1];
- int g_ibTotalSkeets[MAXPLAYERS+1];
- int g_ibTotalSkeetHurts[MAXPLAYERS+1];
- int g_ibTotalMeleeSkeets[MAXPLAYERS+1];
- int g_ibTotalSmgSkeets[MAXPLAYERS+1];
- int g_ibTotalMagnumSkeets[MAXPLAYERS+1];
- int g_ibTotalMagnumHeadShotSkeets[MAXPLAYERS+1];
- int g_ibTotalTongueCuts[MAXPLAYERS+1];
- int g_ibTotalSmokerSelfClears[MAXPLAYERS+1];
- int g_ibTotalChargerLevels[MAXPLAYERS+1];
- int g_ibTotalChargerLevelHurts[MAXPLAYERS+1];
- int g_ibTotalRockSkeet[MAXPLAYERS+1];
- int g_ibTotalBoomerPops[MAXPLAYERS+1];
- int g_ibTotalJockeySkeets[MAXPLAYERS+1];
- int g_ibTotalSurvivorIncaps[MAXPLAYERS+1];
- int g_ibTotalFriendlyFire[MAXPLAYERS+1];
- int g_ibTotalUsedPills[MAXPLAYERS+1];
- int g_ibTotalCarAlarmTriggered[MAXPLAYERS+1];
- int g_ibTotalCarAlarmTriggeredBoomer[MAXPLAYERS+1];
- int g_ibTotalSurvivorPounced[MAXPLAYERS+1];
- int g_ibTotalSurvivorTankRockHits[MAXPLAYERS+1];
- int g_ibTotalHunterCaps[MAXPLAYERS+1];
- int g_ibTotalJockeyCaps[MAXPLAYERS+1];
- int g_ibTotalSmokerCaps[MAXPLAYERS+1];
- int g_ibTotalChargerCaps[MAXPLAYERS+1];
- int g_ibTotalBoomerVomits[MAXPLAYERS+1];
- int g_ibTotalChargerImpacts[MAXPLAYERS+1];
- int g_ibTotalChargerInstaKills[MAXPLAYERS+1];
- int g_ibTotalHunterPounces[MAXPLAYERS+1];
- int g_ibTotalTankPunch[MAXPLAYERS+1];
- int g_ibTotalTankIncaps[MAXPLAYERS+1];
- int g_ibTotalTankPropHits[MAXPLAYERS+1];
- int g_ibTotalClears[MAXPLAYERS+1];
- int g_ibAcummulatedSurvivorKills[MAXPLAYERS+1];
- int g_ibAcummulatedInfectedKills[MAXPLAYERS+1];
- int g_ibAcummulatedInfectedIncap[MAXPLAYERS+1];
- int g_ibAcummulatedCommons[MAXPLAYERS+1];
- int g_ibTotalBoomerDamage[MAXPLAYERS+1];
- int g_ibTotalSpitterDamage[MAXPLAYERS+1];
- float g_fbClearsTime[MAXPLAYERS+1][512];
- float g_fbClearsAverage[MAXPLAYERS+1];
- // Buffer
- int iSur[4];
- int iInf[4];
- char sSurNames[4][MAX_NAME_LENGTH];
- char sInfNames[4][MAX_NAME_LENGTH];
- char sSurNameSpaces[8][8];
- char sInfNameSpaces[8][8];
- char sClearTimes[4][22];
- bool g_bbPlayerCanUseInfoCmd[MAXPLAYERS+1];
- bool g_bbAllowedToSend;
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- public Plugin myinfo = {
- name = "Skill Level and Elo System (Console info)",
- author = "Mis",
- description = "Console info module of the SkillLevel package",
- version = "0.1.0",
- url = "https://github.com/misdocumeno/L4D2_SkillLevel_Elo_System"
- };
- // *********************************************************** //
- // *********** || S T O C K F U N C T I O N S || *********** //
- // *********************************************************** //
- public void OnPluginStart()
- {
- HookEvent("round_end", OnRoundEnd_Event, EventHookMode_Post);
- HookEvent("round_start", OnRoundStart_Event, EventHookMode_Post);
- RegConsoleCmd("sm_consoleinfo", ConsoleInfoCommand);
- }
- // *********************************************************** //
- // *** || P L U G I N S S T O C K F U N C T I O N S || *** //
- // *********************************************************** //
- static void BufferReset()
- {
- for (int i = 1; i <= MaxClients; i++)
- {
- g_ibAcummulatedCommons[i] = 0;
- g_ibAcummulatedSurvivorKills[i] = 0;
- g_ibAcummulatedInfectedKills[i] = 0;
- g_ibAcummulatedInfectedIncap[i] = 0;
- g_ibTotalRockSkeet[i] = 0;
- g_ibTotalAssists[i] = 0;
- g_ibTotalSkeets[i] = 0;
- g_ibTotalSkeetHurts[i] = 0;
- g_ibTotalMeleeSkeets[i] = 0;
- g_ibTotalSmgSkeets[i] = 0;
- g_ibTotalMagnumSkeets[i] = 0;
- g_ibTotalMagnumHeadShotSkeets[i] = 0;
- g_ibTotalTongueCuts[i] = 0;
- g_ibTotalSmokerSelfClears[i] = 0;
- g_ibTotalChargerLevels[i] = 0;
- g_ibTotalChargerLevelHurts[i] = 0;
- g_ibTotalBoomerPops[i] = 0;
- g_ibTotalJockeySkeets[i] = 0;
- g_ibTotalSurvivorIncaps[i] = 0;
- g_ibTotalFriendlyFire[i] = 0;
- g_ibTotalUsedPills[i] = 0;
- g_ibTotalCarAlarmTriggered[i] = 0;
- g_ibTotalCarAlarmTriggeredBoomer[i] = 0;
- g_ibTotalSurvivorPounced[i] = 0;
- g_ibTotalSurvivorTankRockHits[i] = 0;
- g_ibTotalHunterCaps[i] = 0;
- g_ibTotalJockeyCaps[i] = 0;
- g_ibTotalSmokerCaps[i] = 0;
- g_ibTotalChargerCaps[i] = 0;
- g_ibTotalBoomerVomits[i] = 0;
- g_ibTotalChargerImpacts[i] = 0;
- g_ibTotalChargerInstaKills[i] = 0;
- g_ibTotalHunterPounces[i] = 0;
- g_ibTotalTankPunch[i] = 0;
- g_ibTotalTankIncaps[i] = 0;
- g_ibTotalTankPropHits[i] = 0;
- g_ibTotalClears[i] = 0;
- g_fbClearsAverage[i] = -1.0;
- g_bbPlayerCanUseInfoCmd[i] = true;
- for (int j = 0; j < 512; j++)
- {
- g_fbClearsTime[i][j] = -1.0;
- }
- }
- }
- public Action AllowInfoCommand(Handle timer, int client)
- {
- g_bbPlayerCanUseInfoCmd[client] = true;
- }
- // *********************************************************** //
- // ************* || P L A Y E R C H E C K S || ************* //
- // *********************************************************** //
- bool IsValidSurvivor(int survivor)
- {
- return (survivor > 0
- && survivor <= MaxClients
- && IsClientInGame(survivor)
- && GetClientTeam(survivor) == 2);
- }
- bool IsValidInfected(int infected)
- {
- return (infected > 0
- && infected <= MaxClients
- && IsClientInGame(infected)
- && GetClientTeam(infected) == 3);
- }
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- // *********************************************************** //
- // *********** || E V E N T F U N C T I O N S || *********** //
- // *********************************************************** //
- public void OnRoundStart_Event(Event event, const char[] name, bool dontBroadcast)
- {
- BufferReset();
- g_bbAllowedToSend = true;
- }
- public void OnRoundEnd_Event(Event event, const char[] name, bool dontBroadcast)
- {
- if (g_bbAllowedToSend)
- {
- g_bbAllowedToSend = false;
- CreateTimer(1.0, OnRoundEndConsoleInfoTimer);
- }
- }
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- // *********************************************************** //
- // ********** || C A L L I N F O E V E N T S || ********** //
- // *********************************************************** //
- static Action ConsoleInfoCommand(int client, any args)
- {
- if (!g_bbPlayerCanUseInfoCmd[client])
- return Plugin_Handled;
- g_bbPlayerCanUseInfoCmd[client] = false;
- CreateTimer(1.0, AllowInfoCommand, client);
- GetSurClients();
- GetFormatNames();
- GetFormatSpaces();
- GetFormatClearTimes();
- CreateTimer(0.05, PrintSurvivorHeader, client);
- CreateTimer(0.10, PrintSurvivorTableA, client);
- CreateTimer(0.15, PrintSurvivorTableB, client);
- CreateTimer(0.20, PrintSurvivorTableC, client);
- CreateTimer(0.25, PrintSurvivorTableD, client);
- CreateTimer(0.30, PrintSurvivorTableE, client);
- CreateTimer(0.35, PrintTableSpaces, client);
- CreateTimer(0.40, PrintInfectedHeader, client);
- CreateTimer(0.45, PrintInfectedTableA, client);
- CreateTimer(0.50, PrintInfectedTableB, client);
- CreateTimer(0.55, PrintInfectedTableC, client);
- CreateTimer(0.60, PrintInfectedTableD, client);
- CreateTimer(0.65, PrintInfectedTableE, client);
- return Plugin_Handled;
- }
- static Action OnRoundEndConsoleInfoTimer(Handle timer)
- {
- GetSurClients();
- GetFormatNames();
- GetFormatSpaces();
- GetFormatClearTimes();
- for (int i = 1; i <= MaxClients; i++)
- {
- if (IsClientInGame(i))
- {
- CreateTimer(0.05, PrintSurvivorHeader, i);
- CreateTimer(0.10, PrintSurvivorTableA, i);
- CreateTimer(0.15, PrintSurvivorTableB, i);
- CreateTimer(0.20, PrintSurvivorTableC, i);
- CreateTimer(0.25, PrintSurvivorTableD, i);
- CreateTimer(0.30, PrintSurvivorTableE, i);
- CreateTimer(0.35, PrintTableSpaces, i);
- CreateTimer(0.40, PrintInfectedHeader, i);
- CreateTimer(0.45, PrintInfectedTableA, i);
- CreateTimer(0.50, PrintInfectedTableB, i);
- CreateTimer(0.55, PrintInfectedTableC, i);
- CreateTimer(0.60, PrintInfectedTableD, i);
- CreateTimer(0.65, PrintInfectedTableE, i);
- }
- }
- }
- // *********************************************************** //
- // *********** || P R I N T F U N C T I O N S || *********** //
- // *********************************************************** //
- public Action PrintSurvivorHeader(Handle timer, int client)
- {
- PrintToConsole(client, "======================================================================================");
- PrintToConsole(client, "| Survivor Stats |%s%s%s|%s%s%s|%s%s%s|%s%s%s|", sSurNameSpaces[0], sSurNames[0], sSurNameSpaces[1], sSurNameSpaces[2], sSurNames[1], sSurNameSpaces[3], sSurNameSpaces[4], sSurNames[2], sSurNameSpaces[5], sSurNameSpaces[6], sSurNames[3], sSurNameSpaces[7]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintSurvivorTableA(Handle timer, int client)
- {
- PrintToConsole(client, "| Kills | %3d | %3d | %3d | %3d |", g_ibAcummulatedSurvivorKills[iSur[0]], g_ibAcummulatedSurvivorKills[iSur[1]], g_ibAcummulatedSurvivorKills[iSur[2]], g_ibAcummulatedSurvivorKills[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Assists | %3d | %3d | %3d | %3d |", g_ibTotalAssists[iSur[0]], g_ibTotalAssists[iSur[1]], g_ibTotalAssists[iSur[2]], g_ibTotalAssists[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Commons | %3d | %3d | %3d | %3d |", g_ibAcummulatedCommons[iSur[0]], g_ibAcummulatedCommons[iSur[1]], g_ibAcummulatedCommons[iSur[2]], g_ibAcummulatedCommons[iSur[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintSurvivorTableB(Handle timer, int client)
- {
- PrintToConsole(client, "| Skeets | %3d | %3d | %3d | %3d |", g_ibTotalSkeets[iSur[0]], g_ibTotalSkeets[iSur[1]], g_ibTotalSkeets[iSur[2]], g_ibTotalSkeets[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Smoker tongue cuts | %3d | %3d | %3d | %3d |", g_ibTotalTongueCuts[iSur[0]], g_ibTotalTongueCuts[iSur[1]], g_ibTotalTongueCuts[iSur[2]], g_ibTotalTongueCuts[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Smoker self clears | %3d | %3d | %3d | %3d |", g_ibTotalSmokerSelfClears[iSur[0]], g_ibTotalSmokerSelfClears[iSur[1]], g_ibTotalSmokerSelfClears[iSur[2]], g_ibTotalSmokerSelfClears[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- }
- public Action PrintSurvivorTableC(Handle timer, int client)
- {
- PrintToConsole(client, "| Charger levels | %3d | %3d | %3d | %3d |", g_ibTotalChargerLevels[iSur[0]], g_ibTotalChargerLevels[iSur[1]], g_ibTotalChargerLevels[iSur[2]], g_ibTotalChargerLevels[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Charger hurt levels | %3d | %3d | %3d | %3d |", g_ibTotalChargerLevelHurts[iSur[0]], g_ibTotalChargerLevelHurts[iSur[1]], g_ibTotalChargerLevelHurts[iSur[2]], g_ibTotalChargerLevelHurts[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Boomer pops | %3d | %3d | %3d | %3d |", g_ibTotalBoomerPops[iSur[0]], g_ibTotalBoomerPops[iSur[1]], g_ibTotalBoomerPops[iSur[2]], g_ibTotalBoomerPops[iSur[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintSurvivorTableD(Handle timer, int client)
- {
- PrintToConsole(client, "| Tank rocks skeeted | %3d | %3d | %3d | %3d |", g_ibTotalRockSkeet[iSur[0]], g_ibTotalRockSkeet[iSur[1]], g_ibTotalRockSkeet[iSur[2]], g_ibTotalRockSkeet[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Tank rocks eated | %3d | %3d | %3d | %3d |", g_ibTotalSurvivorTankRockHits[iSur[0]], g_ibTotalSurvivorTankRockHits[iSur[1]], g_ibTotalSurvivorTankRockHits[iSur[2]], g_ibTotalSurvivorTankRockHits[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Clear time average |%s|%s|%s|%s|", sClearTimes[0], sClearTimes[1], sClearTimes[2], sClearTimes[3]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintSurvivorTableE(Handle timer, int client)
- {
- PrintToConsole(client, "| Incaps | %3d | %3d | %3d | %3d |", g_ibTotalSurvivorIncaps[iSur[0]], g_ibTotalSurvivorIncaps[iSur[1]], g_ibTotalSurvivorIncaps[iSur[2]], g_ibTotalSurvivorIncaps[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Friendly fire | %3d | %3d | %3d | %3d |", g_ibTotalFriendlyFire[iSur[0]], g_ibTotalFriendlyFire[iSur[1]], g_ibTotalFriendlyFire[iSur[2]], g_ibTotalFriendlyFire[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Pills used | %3d | %3d | %3d | %3d |", g_ibTotalUsedPills[iSur[0]], g_ibTotalUsedPills[iSur[1]], g_ibTotalUsedPills[iSur[2]], g_ibTotalUsedPills[iSur[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Hunter pounces | %3d | %3d | %3d | %3d |", g_ibTotalSurvivorPounced[iSur[0]], g_ibTotalSurvivorPounced[iSur[1]], g_ibTotalSurvivorPounced[iSur[2]], g_ibTotalSurvivorPounced[iSur[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintTableSpaces(Handle timer, int client)
- {
- PrintToConsole(client, " ");
- PrintToConsole(client, " ");
- }
- public Action PrintInfectedHeader(Handle timer, int client)
- {
- PrintToConsole(client, "======================================================================================");
- PrintToConsole(client, "| Infected Stats |%s%s%s|%s%s%s|%s%s%s|%s%s%s|", sInfNameSpaces[0], sInfNames[0], sInfNameSpaces[1], sInfNameSpaces[2], sInfNames[1], sInfNameSpaces[3], sInfNameSpaces[4], sInfNames[2], sInfNameSpaces[5], sInfNameSpaces[6], sInfNames[3], sInfNameSpaces[7]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintInfectedTableA(Handle timer, int client)
- {
- PrintToConsole(client, "| Kills | %3d | %3d | %3d | %3d |", g_ibAcummulatedInfectedKills[iInf[0]], g_ibAcummulatedInfectedKills[iInf[1]], g_ibAcummulatedInfectedKills[iInf[2]], g_ibAcummulatedInfectedKills[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Incaps | %3d | %3d | %3d | %3d |", g_ibAcummulatedInfectedIncap[iInf[0]], g_ibAcummulatedInfectedIncap[iInf[1]], g_ibAcummulatedInfectedIncap[iInf[2]], g_ibAcummulatedInfectedIncap[iInf[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintInfectedTableB(Handle timer, int client)
- {
- PrintToConsole(client, "| Hunter caps | %3d | %3d | %3d | %3d |", g_ibTotalHunterCaps[iInf[0]], g_ibTotalHunterCaps[iInf[1]], g_ibTotalHunterCaps[iInf[2]], g_ibTotalHunterCaps[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Hunter pounces | %3d | %3d | %3d | %3d |", g_ibTotalHunterPounces[iInf[0]], g_ibTotalHunterPounces[iInf[1]], g_ibTotalHunterPounces[iInf[2]], g_ibTotalHunterPounces[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Jockey caps | %3d | %3d | %3d | %3d |", g_ibTotalJockeyCaps[iInf[0]], g_ibTotalJockeyCaps[iInf[1]], g_ibTotalJockeyCaps[iInf[2]], g_ibTotalJockeyCaps[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- }
- public Action PrintInfectedTableC(Handle timer, int client)
- {
- PrintToConsole(client, "| Smoker caps | %3d | %3d | %3d | %3d |", g_ibTotalSmokerCaps[iInf[0]], g_ibTotalSmokerCaps[iInf[1]], g_ibTotalSmokerCaps[iInf[2]], g_ibTotalSmokerCaps[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Charger caps | %3d | %3d | %3d | %3d |", g_ibTotalChargerCaps[iInf[0]], g_ibTotalChargerCaps[iInf[1]], g_ibTotalChargerCaps[iInf[2]], g_ibTotalChargerCaps[iInf[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintInfectedTableD(Handle timer, int client)
- {
- PrintToConsole(client, "| Boomer damage | %3d | %3d | %3d | %3d |", g_ibTotalBoomerDamage[iInf[0]], g_ibTotalBoomerDamage[iInf[1]], g_ibTotalBoomerDamage[iInf[2]], g_ibTotalBoomerDamage[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Spitter damage | %3d | %3d | %3d | %3d |", g_ibTotalSpitterDamage[iInf[0]], g_ibTotalSpitterDamage[iInf[1]], g_ibTotalSpitterDamage[iInf[2]], g_ibTotalSpitterDamage[iInf[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- public Action PrintInfectedTableE(Handle timer, int client)
- {
- PrintToConsole(client, "| Tank hits | %3d | %3d | %3d | %3d |", g_ibTotalTankPunch[iInf[0]], g_ibTotalTankPunch[iInf[1]], g_ibTotalTankPunch[iInf[2]], g_ibTotalTankPunch[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Tank hittable hits | %3d | %3d | %3d | %3d |", g_ibTotalTankPropHits[iInf[0]], g_ibTotalTankPropHits[iInf[1]], g_ibTotalTankPropHits[iInf[2]], g_ibTotalTankPropHits[iInf[3]]);
- PrintToConsole(client, "|------------------------|--------------|--------------|--------------|--------------|");
- PrintToConsole(client, "| Tank incaps | %3d | %3d | %3d | %3d |", g_ibTotalTankIncaps[iInf[0]], g_ibTotalTankIncaps[iInf[1]], g_ibTotalTankIncaps[iInf[2]], g_ibTotalTankIncaps[iInf[3]]);
- PrintToConsole(client, "======================================================================================");
- }
- // *********************************************************** //
- // ********** || F O R M A T F U N C T I O N S || ********** //
- // *********************************************************** //
- static void GetSurClients()
- {
- int iSurCount;
- int iInfCount;
- for (int i = 1; i <= MaxClients; i++)
- {
- if (IsValidSurvivor(i))
- {
- iSur[iSurCount] = i;
- iSurCount++;
- }
- else if (IsValidInfected(i))
- {
- iInf[iInfCount] = i;
- iInfCount++;
- }
- }
- }
- static void GetFormatNames()
- {
- char sNone[] = "none";
- for (int i = 0; i < 4; i++)
- {
- if (!iSur[i])
- strcopy(sSurNames[i], sizeof(sSurNames), sNone);
- else
- GetClientName(iSur[i], sSurNames[i], sizeof(sSurNames));
- if (!iInf[i])
- strcopy(sInfNames[i], sizeof(sInfNames), sNone);
- else
- GetClientName(iInf[i], sInfNames[i], sizeof(sInfNames));
- }
- for (int i = 0; i < 4; i++)
- {
- if (strlen(sSurNames[i]) > 14)
- {
- sSurNames[i][11] = '.';
- sSurNames[i][12] = '.';
- sSurNames[i][13] = '.';
- sSurNames[i][14] = 0;
- }
- if (strlen(sInfNames[i]) > 14)
- {
- sInfNames[i][11] = '.';
- sInfNames[i][12] = '.';
- sInfNames[i][13] = '.';
- sInfNames[i][14] = 0;
- }
- }
- }
- static void GetFormatSpaces()
- {
- for (int i = 0; i < 8; i++)
- {
- for (int j = 0; j < 7; j++)
- {
- sSurNameSpaces[i][j] = ' ';
- sInfNameSpaces[i][j] = ' ';
- }
- sSurNameSpaces[i][7] = 0;
- sInfNameSpaces[i][7] = 0;
- }
- for (int i = 0; i < 4; i++)
- {
- int iMissingSpaceSur = 14 - strlen(sSurNames[i]);
- int iSurSpaceLeft = RoundFloat(iMissingSpaceSur / 2.0 - 0.25);
- int iSurSpaceRight = RoundFloat(iMissingSpaceSur /2.0 + 0.25);
- sSurNameSpaces[i*2][iSurSpaceLeft] = 0;
- sSurNameSpaces[i*2+1][iSurSpaceRight] = 0;
- int iMissingSpaceInf = 14 - strlen(sInfNames[i]);
- int iInfSpaceLeft = RoundFloat(iMissingSpaceInf / 2.0 - 0.25);
- int iInfSpaceRight = RoundFloat(iMissingSpaceInf /2.0 + 0.25);
- sInfNameSpaces[i*2][iInfSpaceLeft] = 0;
- sInfNameSpaces[i*2+1][iInfSpaceRight] = 0;
- }
- }
- static void GetFormatClearTimes()
- {
- for (int i = 0; i < 4; i++)
- {
- if (GetClearTimeAverage(iSur[i]) < 10.0 && GetClearTimeAverage(iSur[i]) != -1.0)
- {
- char sFormatClearTimes[] = " %2fs ";
- FormatEx(sClearTimes[i], sizeof(sClearTimes), sFormatClearTimes, GetClearTimeAverage(iSur[i]));
- }
- else if (GetClearTimeAverage(iSur[i]) >= 10.0)
- {
- char sFormatClearTimes[] = " %2fs ";
- FormatEx(sClearTimes[i], sizeof(sClearTimes), sFormatClearTimes, GetClearTimeAverage(iSur[i]));
- }
- else
- {
- char sFormatClearTimes[] = " No clears! ";
- strcopy(sClearTimes[i], sizeof(sClearTimes), sFormatClearTimes);
- }
- }
- }
- float GetClearTimeAverage(int client)
- {
- float fTimeBuffer;
- int iClearsAmount;
- for (int i = 0; i < 512; i++)
- {
- if (g_fbClearsTime[client][i] != -1.0)
- {
- fTimeBuffer += g_fbClearsTime[client][i];
- iClearsAmount++;
- }
- }
- if (iClearsAmount)
- return fTimeBuffer / iClearsAmount;
- else
- return -1.0;
- }
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- /*************************************************************************************************************************************************/
- // *********************************************************** //
- // ************* || M A I N F O R W A R D S || ************* //
- // *********************************************************** //
- //// [ SURVIVOR ] ////
- public void EloSurvivorKill(int survivor)
- {
- g_ibAcummulatedSurvivorKills[survivor]++;
- }
- public void EloSurvivorKill2(int survivor)
- {
- g_ibAcummulatedSurvivorKills[survivor]++;
- }
- public void EloSurvivorKill3(int survivor)
- {
- g_ibAcummulatedSurvivorKills[survivor]++;
- }
- public void EloSurvivorKill4(int survivor)
- {
- g_ibAcummulatedSurvivorKills[survivor]++;
- }
- public void EloSurvivorAssist(int survivor)
- {
- g_ibTotalAssists[survivor]++;
- }
- public void EloSurvivorSkeet(int survivor)
- {
- g_ibTotalSkeets[survivor]++;
- }
- public void EloSurvivorSkeetHurt(int survivor)
- {
- g_ibTotalSkeets[survivor]++;
- }
- public void EloSurvivorSkeetMelee(int survivor)
- {
- g_ibTotalSkeets[survivor]++;
- }
- public void EloSurvivorSkeetSmg(int survivor)
- {
- g_ibTotalSkeets[survivor]++;
- }
- public void EloSurvivorSkeetMagnum(int survivor)
- {
- g_ibTotalSkeets[survivor]++;
- }
- public void EloSurvivorSkeetMagnumHeadShot(int survivor)
- {
- g_ibTotalSkeets[survivor]++;
- }
- public void EloSurvivorBoomerPop(int survivor)
- {
- g_ibTotalBoomerPops[survivor]++;
- }
- public void EloSurvivorSmokerSelfClear(int survivor)
- {
- g_ibTotalSmokerSelfClears[survivor]++;
- }
- public void EloSurvivorSmokerTongueCut(int survivor)
- {
- g_ibTotalTongueCuts[survivor]++;
- }
- public void EloSurvivorJockeySkeet(int survivor)
- {
- g_ibTotalJockeySkeets[survivor]++;
- }
- public void EloSurvivorChargerLevel(int survivor)
- {
- g_ibTotalChargerLevels[survivor]++;
- }
- public void EloSurvivorChargerLevelHurt(int survivor)
- {
- g_ibTotalChargerLevelHurts[survivor]++;
- }
- public void EloSurvivorRockSkeet(int survivor)
- {
- g_ibTotalRockSkeet[survivor]++;
- }
- public void EloSurvivorClearTime(int survivor, float ftime)
- {
- for (int i = 1; i <= 512; i++)
- {
- if (g_fbClearsTime[float(survivor)][float(i)] == -1.0)
- {
- g_fbClearsTime[float(survivor)][float(i)] = ftime;
- break;
- }
- }
- }
- public void EloSurvivorCommons(int survivor)
- {
- g_ibAcummulatedCommons[survivor]++;
- }
- public void EloSurvivorIncapacitated(int survivor)
- {
- g_ibTotalSurvivorIncaps[survivor]++;
- }
- public void EloSurvivorFF(int survivor, int damage)
- {
- g_ibTotalFriendlyFire[survivor] += damage;
- }
- public void EloSurvivorTankRockEaten(int survivor)
- {
- g_ibTotalSurvivorTankRockHits[survivor]++;
- }
- public void g_hEloSurvivorPounced15(int survivor)
- {
- g_ibTotalSurvivorPounced[survivor]++;
- }
- public void g_hEloSurvivorPounced20(int survivor)
- {
- g_ibTotalSurvivorPounced[survivor]++;
- }
- public void g_hEloSurvivorPounced25(int survivor)
- {
- g_ibTotalSurvivorPounced[survivor]++;
- }
- public void EloSurvivorPillsUsed(int survivor)
- {
- g_ibTotalUsedPills[survivor]++;
- }
- //// [ INFECTED ] ////
- public void EloInfectedDamage(int infected, int damage)
- {
- if (GetEntProp(infected, Prop_Send, "m_zombieClass") == 2)
- g_ibTotalBoomerDamage[infected] += damage;
- if (GetEntProp(infected, Prop_Send, "m_zombieClass") == 4)
- g_ibTotalSpitterDamage[infected] += damage;
- }
- public void EloInfectedKill(int infected)
- {
- g_ibAcummulatedInfectedKills[infected]++;
- }
- public void EloInfectedIncap(int infected)
- {
- g_ibAcummulatedInfectedIncap[infected]++;
- }
- public void EloInfectedHunterCap(int infected)
- {
- g_ibTotalHunterCaps[infected]++;
- }
- public void EloInfectedHighPounce15(int infected)
- {
- g_ibTotalHunterPounces[infected]++;
- }
- public void EloInfectedHighPounce20(int infected)
- {
- g_ibTotalHunterPounces[infected]++;
- }
- public void EloInfectedHighPounce25(int infected)
- {
- g_ibTotalHunterPounces[infected]++;
- }
- public void EloInfectedJockeyCap(int infected)
- {
- g_ibTotalJockeyCaps[infected]++;
- }
- public void EloInfectedSmokerCap(int infected)
- {
- g_ibTotalSmokerCaps[infected]++;
- }
- public void EloInfectedChargerCap(int infected)
- {
- g_ibTotalChargerCaps[infected]++;
- }
- public void EloInfectedChargerImpact(int infected)
- {
- g_ibTotalChargerImpacts[infected]++;
- }
- public void EloInfectedChargerInstaKill(int infected)
- {
- g_ibTotalChargerInstaKills[infected]++;
- }
- public void EloInfectedBoomerVomit1(int infected)
- {
- g_ibTotalBoomerVomits[infected]++;
- }
- public void EloInfectedBoomerVomit2(int infected)
- {
- g_ibTotalBoomerVomits[infected] += 2;
- }
- public void EloInfectedBoomerVomit3(int infected)
- {
- g_ibTotalBoomerVomits[infected] += 3;
- }
- public void EloInfectedBoomerVomit4(int infected)
- {
- g_ibTotalBoomerVomits[infected] += 4;
- }
- public void EloInfectedTankPunch(int infected)
- {
- g_ibTotalTankPunch[infected]++;
- }
- public void EloInfectedTankPropHit(int infected)
- {
- g_ibTotalTankPropHits[infected]++;
- }
- public void EloInfectedTankIncap(int infected)
- {
- g_ibTotalTankIncaps[infected]++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement