SA-MP Forums Archive
Kill/deaths logs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kill/deaths logs (/showthread.php?tid=529866)



Kill/deaths logs - Hybris - 04.08.2014

Hello I was wondering if anyone could help me out on a kill/death log which sould send the message to the admin via chatbox?I just need a little boost from where to start.


Re: Kill/deaths logs - Stinged - 04.08.2014

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    for (new i = 0; i != MAX_PLAYERS; i++) // If you have foreach, replace this with foreach (new i : Player)
    {
        if (IsPlayerAdmin(i))
        {
            if (killerid != INVALID_PLAYER_ID)
            {
                new string[115], pname[24], pname2[24], gunname[32];
                GetPlayerName(playerid, pname, sizeof (pname));
                GetPlayerName(killerid, pname2, sizeof (pname2));
                GetWeaponName(reason, gunname, sizeof (gunname));
                format(string, sizeof (string), "%s (%i) killed %s (%i) with a %s",  pname2, killerid, pname, playerid, gunname);
                SendClientMessage(i, -1, string);
            }
        }
    }
    return 1;
}