KnifeRevert: more oops

This commit is contained in:
Dogan 2019-10-13 20:57:17 +02:00
parent a4791a1888
commit b85d1e9750

View File

@ -5,7 +5,7 @@
#include <sdktools>
#include <zombiereloaded>
bool g_bZAbuse;
bool g_bKnifeRevert;
bool g_bSlayKnifer;
float g_fMaxDistance;
float g_fMaxTime;
@ -28,7 +28,7 @@ public void OnPluginStart()
{
ConVar cvar;
HookConVarChange((cvar = CreateConVar("sm_kr_enabled", "1", "1 = sm_zabuse is available, 0 = sm_zabuse is not available", FCVAR_NONE, true, 0.0, true, 1.0)), g_cvZAbuse);
g_bZAbuse = cvar.BoolValue;
g_bKnifeRevert = cvar.BoolValue;
HookConVarChange((cvar = CreateConVar("sm_kr_slay", "0", "1 = slays the knifer automatically when sm_zabuse is used, 0 = don't do anything to the knifer", FCVAR_NONE, true, 0.0, true, 1.0)), g_cvSlayKnifer);
g_bSlayKnifer = cvar.BoolValue;
HookConVarChange((cvar = CreateConVar("sm_kr_maxdistance", "150.0", "max distance from the zombie that got knifed forward where infected humans will be rezurrected")), g_cvMaxDistance);
@ -39,8 +39,8 @@ public void OnPluginStart()
HookEvent("player_hurt", OnPlayerHurt);
RegAdminCmd("sm_kr", Command_ZAbuse, ADMFLAG_GENERIC, "Undoes the damage caused by a zombie after being knifed forward");
RegAdminCmd("sm_kniferevert", Command_ZAbuse, ADMFLAG_GENERIC, "Undoes the damage caused by a zombie after being knifed forward");
RegAdminCmd("sm_kr", Command_KnifeRevert, ADMFLAG_GENERIC, "Undoes the damage caused by a zombie after being knifed forward");
RegAdminCmd("sm_kniferevert", Command_KnifeRevert, ADMFLAG_GENERIC, "Undoes the damage caused by a zombie after being knifed forward");
AutoExecConfig(true, "plugin.KnifeRevert");
@ -50,7 +50,7 @@ public void OnPluginStart()
public void g_cvZAbuse(ConVar convar, const char[] oldValue, const char[] newValue)
{
g_bZAbuse = convar.BoolValue;
g_bKnifeRevert = convar.BoolValue;
}
public void g_cvSlayKnifer(ConVar convar, const char[] oldValue, const char[] newValue)
@ -70,7 +70,7 @@ public void g_cvMaxTime(ConVar convar, const char[] oldValue, const char[] newVa
public void OnPlayerHurt(Handle hEvent, const char[] name, bool dontBroadcast)
{
if(!g_bZAbuse)
if(!g_bKnifeRevert)
return;
int attacker;
@ -125,7 +125,7 @@ public Action OnClientKnife(Handle timer)
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
{
if(!g_bZAbuse || !g_bKnife)
if(!g_bKnifeRevert || !g_bKnife)
return;
static float fVec1[3];
@ -139,9 +139,9 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
g_bInfectedInRadius[client] = true;
}
public Action Command_ZAbuse(int client, int argc)
public Action Command_KnifeRevert(int client, int argc)
{
if(!g_bZAbuse)
if(!g_bKnifeRevert)
{
ReplyToCommand(client, "[SM] Disabled on this Map.");
return Plugin_Handled;