PHP Code:
#include <sourcemod>
#include <sdkhooks>
public void OnClientPutInServer(int Client)
{
SDKHookEx(Client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
/*
*
* Check if the victim has shield equiped
*
*/
int weapon = GetEntPropEnt(victim, Prop_Data, "m_hActiveWeapon");
char classname[64];
GetEdictClassname(weapon, classname, sizeof(classname));
if (strcmp(classname, "weapon_shield") == 0)
{
PrintToChatAll("Damage with shield: %f", damage);
}
return Plugin_Continue;
}
Not the best option but you can test with it.
__________________