From 3021aae14ea62f30f8e2dd1e20ffe444748293e3 Mon Sep 17 00:00:00 2001 From: neon <> Date: Wed, 15 Jan 2020 17:51:48 +0100 Subject: [PATCH] Revert "bla bla" This reverts commit e41285887860fa9ac298d15e3fdaf7be0ecfc59d. --- RepeatKiller/scripting/RepeatKiller.sp | 20 ++++++++++---------- secrets | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) create mode 160000 secrets diff --git a/RepeatKiller/scripting/RepeatKiller.sp b/RepeatKiller/scripting/RepeatKiller.sp index 8a859eab..5615c143 100644 --- a/RepeatKiller/scripting/RepeatKiller.sp +++ b/RepeatKiller/scripting/RepeatKiller.sp @@ -9,7 +9,7 @@ float g_fDeathTime[MAXPLAYERS+1]; /* CONVARS */ ConVar g_hRespawnDelay; -ConVar g_hRespawnTreshold; //Test +ConVar g_hRespawnTreshold; //---------------------------------------------------------------------------------------------------- // Purpose: @@ -30,12 +30,12 @@ public void OnPluginStart() { if((g_hRespawnDelay = FindConVar("zr_respawn_delay")) == INVALID_HANDLE) SetFailState("Failed to find zr_respawn_delay cvar."); - + g_hRespawnTreshold = CreateConVar("zr_repeatkill_threshold", "1.0", "Zombie Reloaded Repeat Kill Detector Threshold", 0, true, 0.0, true, 10.0); - + HookEvent("round_start", OnRoundStart); HookEvent("player_death", OnClientDeath); - + AutoExecConfig(true, "plugin.RepeatKillDetector"); } @@ -64,23 +64,23 @@ public void OnClientDeath(Event hEvent, const char[] sEvent, bool bDontBroadcast { char sWeapon[32]; hEvent.GetString("weapon", sWeapon, sizeof(sWeapon)) - + int victim = GetClientOfUserId(hEvent.GetInt("userid")); int client = GetClientOfUserId(hEvent.GetInt("attacker")); - + if (g_bBlockRespawn[victim]) return; - + if (victim && !client && StrEqual(sWeapon, "trigger_hurt")) { float fGameTime = GetGameTime(); - + if (fGameTime - g_fDeathTime[victim] - g_hRespawnDelay.FloatValue <= g_hRespawnTreshold.FloatValue) { PrintToChat(victim, "\x04[ZR]\x01 Repeat killer detected. Disabling your respawn for this round."); g_bBlockRespawn[victim] = true; } - + g_fDeathTime[victim] = fGameTime; } } @@ -92,6 +92,6 @@ public Action ZR_OnClientRespawn(&client, &ZR_RespawnCondition:condition) { if (g_bBlockRespawn[client]) return Plugin_Handled; - + return Plugin_Continue; } \ No newline at end of file diff --git a/secrets b/secrets new file mode 160000 index 00000000..e0dfc412 --- /dev/null +++ b/secrets @@ -0,0 +1 @@ +Subproject commit e0dfc41273433d455c61411d3c2761f317b72244