PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
public void OnClientPostAdminCheck(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action SDK_OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3])
{
if (weapon != -1)
{
if (damagetype & DMG_SHOCK)
{
return Plugin_Handled;
}
else if (damagetype & DMG_SLASH)
{
return Plugin_Handled;
}
return Plugin_Continue;
}
}
Check if there's a valid weapon, trigger_hurts can do these types of damage.
__________________