#include <sdkhooks>
public void OnPluginStart()
{
for(int i = 1; i <= MaxClients; i++) if(IsClientInGame(i)) OnClientPutInServer(i);
}
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action OnTakeDamage(int victim, int& attacker, int& inflictor, float& damage, int& damagetype, int& weapon, float damageForce[3], float damagePosition[3])
{
static char sWeapon[64], buffer[128];
buffer[0] = sWeapon[0] = 0;
if(0 < attacker <= MaxClients && IsClientInGame(attacker))
GetClientWeapon(attacker, buffer, sizeof(buffer));
if(weapon > MaxClients && IsValidEntity(weapon) && GetEntityClassname(weapon, sWeapon, sizeof(sWeapon)))
Format(buffer, sizeof(buffer), "%s, Weapon: %i (%s)", buffer, weapon, sWeapon);
PrintToChatAll("Victim: %i, Attacker: %i, Inflictor: %i\nDmg: %.2f, DmgType: %i\nClWeapon: %s",
victim, attacker, inflictor, damage, damagetype, buffer);
damage = 0.0;
return Plugin_Changed;
}