Thread: Edit plugin
View Single Post
versatile_bfg
Veteran Member
Join Date: Feb 2012
Old 06-15-2015 , 21:10   Re: Edit plugin
Reply With Quote #7

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 (
victim <= MaxClients && attacker <= MaxClients)
    {
        if (
victim == attacker)
        {
            
PrintToChatAll("\"%N\" suicided."victim);
        }
        else
        {
            
PrintToChatAll("\"%N\" was killed by \"%N\"."victimattacker);
        }
    }

__________________

Last edited by versatile_bfg; 06-15-2015 at 21:12.
versatile_bfg is offline