SA-MP Forums Archive
[HELP]Top 5 Killers - 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: [HELP]Top 5 Killers (/showthread.php?tid=423172)



[HELP]Top 5 Killers - [R]ambo - 16.03.2013

Can someone help me build a top 5 killers system that could be shown under a command. Or if someone could link me to a thread/filterscript that contains the help I am looking for?!? ThankYou.


Re: [HELP]Top 5 Killers - Denying - 16.03.2013

pawn Код:
new topkills[5], kills[MAX_PLAYERS], name[MAX_PLAYER_NAME];

OnPlayerDeath(playerid, killerid, reason)
{
    kills[killerid]++;
    for(new i = 0; i < 5; i++)
    {
        if(kills[killerid] > topkills[i])
        {
            topkills[i] = kills[killerid];
            GetPlayerName(killerid, name, sizeof(name));
        }
    }
    return 1;
}
Something like this, this raise a player's kill whenever he kills someone, will check if one in the top 5 kills has killed that much, if no it will replace it, and it will get the player's name if he has killed more than one of the top 5 killers, do with that whatever you want, want to save the name somewhere? do it. You can just modify it/add things to it however you want, if you need more help, tell me.

( It is not tested, I wrote it here in this chat )