This might work:
PHP Code:
#include <sdkhooks>
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], damagecustom)
{
if(IsValidClient(attacker))
{
decl String:steamid_victim[32];
GetClientAuthString(victim, steamid_victim, sizeof(steamid_victim))
decl String:steamid_attacker[32];
GetClientAuthString(attacker, steamid_attacker, sizeof(steamid_attacker))
new String:path[128];
BuildPath(Path_SM, path, sizeof(path), "logs/damagelogs.txt");
LogToFile(path, "Player %N (%s) from %i team has been hurt by %N (%s) from from team %i with %f damage", victim, steamid_victim, GetClientTeam(victim), attacker, steamid_attacker, GetClientTeam(attacker), damage)
}
return Plugin_Continue;
}
stock bool:IsValidClient(client)
{
if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) )
return false;
return true;
}
It should print detailed data to sourcmeod/logs/damagelogs.txt
__________________