Ah forgot about world
Only quickly put it together.
Would also need to check that the attacker isn't the victim as then it would print Bob was killed by Bob. Which is acceptable but wouldn't it be better to have Bob killed himself or Bob suicided.
PHP Code:
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if (0 < victim <= MaxClients && 0 < attacker <= MaxClients)
{
if (victim == attacker)
{
PrintToChatAll("\"%N\" suicided.", victim);
}
else
{
PrintToChatAll("\"%N\" was killed by \"%N\".", victim, attacker);
}
}
}
__________________