diff --git a/AntiNoob/scripting/AntiNoob.sp b/AntiNoob/scripting/AntiNoob.sp index 3044e00e..7d570e39 100644 --- a/AntiNoob/scripting/AntiNoob.sp +++ b/AntiNoob/scripting/AntiNoob.sp @@ -33,7 +33,7 @@ int g_iMaxPopulation; float g_fKnockbackPopulationBoost; float g_fNapalmPopulationReduction; -int g_iAntiNoob; +bool g_bAntiNoob; char g_cAntiNoobHelp[64]; char g_cAntiNoobPopulation[32]; @@ -52,7 +52,7 @@ public void OnPluginStart() ConVar cvar; HookConVarChange((cvar = CreateConVar("sm_an_help", "1", "1 = AntiNoob performs help, 0 = AntiNoob is disabled", FCVAR_NONE, true, 0.0, true, 1.0)), g_cvAntiNoob); - g_iAntiNoob = cvar.IntValue; + g_bAntiNoob = cvar.BoolValue; HookConVarChange((cvar = CreateConVar("sm_an_maxplayers", "40", "max active players until the kb should be increased")), g_cvMaxPopulation); g_iMaxPopulation = cvar.IntValue; HookConVarChange((cvar = CreateConVar("sm_an_kb_population", "5.0", "knockback boost during low population in procent (stacks with the helps)")), g_cvKnockbackPopulationBoost); @@ -95,7 +95,7 @@ public void OnPluginStart() public void g_cvAntiNoob(ConVar convar, const char[] oldValue, const char[] newValue) { - g_iAntiNoob = convar.IntValue; + g_bAntiNoob = convar.BoolValue; } public void g_cvMaxPopulation(ConVar convar, const char[] oldValue, const char[] newValue) @@ -218,7 +218,7 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast) } } - if(g_iAntiNoob == 0) + if(!g_bAntiNoob) { g_cAntiNoobHelp = "{cyan}[AntiNoob]{white} Currently disabled"; g_cAntiNoobPopulation = "{white}."; @@ -315,7 +315,7 @@ public void PerformLowHelp() public void PerformReset() { - if(g_bLowPopulation && g_iAntiNoob != 0) + if(g_bLowPopulation && g_bAntiNoob) { ServerCommand("zr_class_set_multiplier zombies knockback %f", 1.0 + g_fKnockbackPopulationBoost); ServerCommand("zr_napalm_time_scale %f", 50.0 - g_fNapalmPopulationReduction); diff --git a/ZAbuse/scripting/ZAbuse.sp b/KnifeRevert/scripting/KnifeRevert.sp similarity index 89% rename from ZAbuse/scripting/ZAbuse.sp rename to KnifeRevert/scripting/KnifeRevert.sp index 0015ee1a..9ea20007 100644 --- a/ZAbuse/scripting/ZAbuse.sp +++ b/KnifeRevert/scripting/KnifeRevert.sp @@ -5,8 +5,8 @@ #include #include -int g_iZAbuse; -int g_iSlayKnifer; +bool g_bZAbuse; +bool g_bSlayKnifer; float g_fMaxDistance; float g_fMaxTime; @@ -17,10 +17,10 @@ bool g_bInfectedInRadius[MAXPLAYERS + 1]; public Plugin myinfo = { - name = "ZAbuse", + name = "KnifeRevert", author = "Dogan", description = "Tool for Admins to prevent teamkilling cause of zombie knifing (ZE)", - version = "1.0.0", + version = "1.1.0", url = "" } @@ -28,9 +28,9 @@ public void OnPluginStart() { ConVar cvar; HookConVarChange((cvar = CreateConVar("sm_zabuse_enabled", "1", "1 = sm_zabuse is available, 0 = sm_zabuse is not available", FCVAR_NONE, true, 0.0, true, 1.0)), g_cvZAbuse); - g_iZAbuse = cvar.IntValue; + g_bZAbuse = cvar.BoolValue; HookConVarChange((cvar = CreateConVar("sm_zabuse_slay", "1", "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_iSlayKnifer = cvar.IntValue; + g_bSlayKnifer = cvar.BoolValue; HookConVarChange((cvar = CreateConVar("sm_zabuse_maxdistance", "150.0", "max distance from the zombie that got knifed forward where infected humans will be rezurrected")), g_cvMaxDistance); g_fMaxDistance = cvar.FloatValue; HookConVarChange((cvar = CreateConVar("sm_zabuse_time", "5.0", "max time until sm_zabuse is available after a knife")), g_cvMaxTime); @@ -39,7 +39,8 @@ public void OnPluginStart() HookEvent("player_hurt", OnPlayerHurt); - RegAdminCmd("sm_zabuse", Command_ZAbuse, ADMFLAG_GENERIC, "Undoes the damage caused by a zombie after being knifed forward"); + 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"); AutoExecConfig(true, "plugin.ZAbuse"); @@ -49,12 +50,12 @@ public void OnPluginStart() public void g_cvZAbuse(ConVar convar, const char[] oldValue, const char[] newValue) { - g_iZAbuse = convar.IntValue; + g_bZAbuse = convar.BoolValue; } public void g_cvSlayKnifer(ConVar convar, const char[] oldValue, const char[] newValue) { - g_iSlayKnifer = convar.IntValue; + g_bSlayKnifer = convar.BoolValue; } public void g_cvMaxDistance(ConVar convar, const char[] oldValue, const char[] newValue) @@ -69,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_iZAbuse == 0) + if(!g_bZAbuse) return; int attacker; @@ -124,7 +125,7 @@ public Action OnClientKnife(Handle timer) public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn) { - if(g_iZAbuse == 0 || !g_bKnife) + if(!g_bZAbuse || !g_bKnife) return; static float fVec1[3]; @@ -140,7 +141,7 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo public Action Command_ZAbuse(int client, int argc) { - if(g_iZAbuse == 0) + if(!g_bZAbuse) { ReplyToCommand(client, "[SM] Disabled on this Map."); return Plugin_Handled; @@ -156,7 +157,7 @@ public Action Command_ZAbuse(int client, int argc) PrintToChatAll("[SM] %N undid the damage from the previous Zombie Knife.", client); LogAction(client, -1, "\"%L\" undid the damage from the previous Zombie Knife.", client); - if(g_iSlayKnifer == 1) + if(g_bSlayKnifer) { ForcePlayerSuicide(g_iClientIndexKnifer); PrintToChat(g_iClientIndexKnifer, "[SM] You got slayed for knifing a Zombie forward!");