EDIT:
After posting this I found a very large problem with the plugin (the infinite heal glitch returns whenever the client is healed, even with the normal medigun), and I cannot think of a suitable fix, as such I am withdrawing the plugin, but here is the code should you want it:
Code:
#pragma semicolon 1
#define PL_VERSION "1.0"
#include <sourcemod>
#include <tf2>
#include <tf2_stocks>
new bool:g_ClientBeingAmputated[MAXPLAYERS+1] = false;
public Plugin:myinfo =
{
name = "Amputator Fix",
author = "Geit",
description = "Fixes the Amputator Glitch",
version = PL_VERSION,
url = "Gamingmasters.co.uk"
};
public OnClientDisconnect(client)
{
g_ClientBeingAmputated[client] = false;
}
public OnGameFrame()
{
for(new client=1; client <= MaxClients; client++)
{
if (IsClientInGame(client))
{
new flags = TF2_GetPlayerConditionFlags(client);
if(flags & (1 << 20) && flags & (1 << 21))
{
g_ClientBeingAmputated[client] = true;
}
if(g_ClientBeingAmputated[client] && flags & (1 << 20) && flags & (1 << 21))
{
g_ClientBeingAmputated[client] = true;
}
else if (g_ClientBeingAmputated[client])
{
g_ClientBeingAmputated[client] = false;
SetEntProp(client, Prop_Send, "m_nNumHealers", 0);
new new_flags;
if (flags-(1 << 21) < 0)
{
new_flags = 0;
}
else
{
new_flags=flags-(1 << 21);
}
SetEntProp(client, Prop_Send, "m_nPlayerCond", new_flags);
}
}
}
}