Код
public Event_OnPlayerHurt(Handle:event, const String:name[], bool:silent)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if (attacker > 0)
{
if (!IsFakeClient(attacker))
{
new dmg = GetEventInt(event, "dmg_health"), hp = GetEventInt(event, "health");
PrintCenterText(attacker, "-%d", dmg > hp ? hp : dmg);
}
}
}
По желанию:
Код
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
{
if (GetClientTeam(attacker) != GetClientTeam(client))
{
// Code...
}
}