I have not tested.
But it look player who attack himself with projectile, then look team, finally look player class is Tank.
Plugin block damage.
PHP Code:
enum {
team_none = 0,
team_spec,
team_survivors,
team_infected
};
enum {
Infected = 0,
Smoker,
Boomer,
Hunter,
Spitter,
Jockey,
Charger,
unknown,
Tank,
Survivor,
Witch
};
//char infected[][] = {
// "Infected",
// "Smoker",
// "Boomer",
// "Hunter",
// "Spitter",
// "Jockey",
// "Charger",
// "unknown",
// "Tank",
// "Survivor",
// "Witch"
//}
#include <sdkhooks>
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
// player attack himself with projectile
if(!(victim == attacker &&
attacker != inflictor))
return Plugin_Continue;
if(GetClientTeam(victim) != team_infected)
return Plugin_Continue;
//char buffer[15];
int m_zombieClass = 0;
if(HasEntProp(victim, Prop_Send, "m_zombieClass"))
{
m_zombieClass = GetEntProp(victim, Prop_Send, "m_zombieClass");
}
//else
//{
// GetEntityClassname(victim, buffer, sizeof(buffer));
//
// if(StrEqual(buffer, infected[Witch], false))
// m_zombieClass = Witch; // this class is now customized manually...
//}
switch(m_zombieClass)
{
case Infected:
{
}
case Tank:
{
return Plugin_Handled;
}
}
return Plugin_Continue;
}
__________________