1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #pragma semicolon 1
- #include <sourcemod>
- #include <tf2_stocks>
- #pragma newdecls required
- #define PLUGIN_VERSION "1.0.0"
- public Plugin myinfo = {
- name = "[CSRD] Extended Humiliation Round Fixes",
- author = "nosoop",
- description = "Improvements to deal with extended humiliation rounds.",
- version = PLUGIN_VERSION,
- url = "https://git.csrd.science/"
- }
- #define HIDEHUD_HEALTH ( 1 << 3 )
- public void OnPluginStart() {
- HookEvent("teamplay_round_win", OnRoundWin, EventHookMode_PostNoCopy);
- }
- public void OnRoundWin(Event event, const char[] name, bool dontBroadcast) {
-
- if ((FindConVar("mp_bonusroundtime").IntValue > 5)) {
- CreateTimer(5.0, HideWinPanelAll);
- }
- }
- public Action HideWinPanelAll(Handle timer, any discard) {
- int clients[MAXPLAYERS], numClients;
-
- for (int i = 1; i <= MaxClients; i++) {
- if (!IsClientInGame(i) || IsFakeClient(i)) {
- continue;
- }
-
- TFTeam team = TF2_GetClientTeam(i);
-
- if (team == TFTeam_Red || team == TFTeam_Blue) {
- clients[numClients++] = i;
-
-
- SetEntProp(i, Prop_Data, "m_iHideHUD", HIDEHUD_HEALTH);
- }
- }
-
- TF2_HideWinPanel(clients, numClients);
- }
- stock void TF2_HideWinPanel(const int[] clients, int numClients) {
- if (numClients) {
- Event event = CreateEvent("teamplay_round_start", true);
-
- #if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR > 8
-
- event.BroadcastDisabled = true;
- #endif
-
- for (int i = 0; i < numClients; i++) {
- event.FireToClient(clients[i]);
- }
-
- delete event;
- }
- }
|