SA-MP Forums Archive
How to detect the player who has the highes ect ... [+Rep if you help me] - 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: How to detect the player who has the highes ect ... [+Rep if you help me] (/showthread.php?tid=307467)



How to detect the player who has the highes ect ... [+Rep if you help me] - Amine_Mejrhirrou - 30.12.2011

when a player kill an other player ! the killerid has
Код:
gPlayerKills[ killerid ]++;
i would like to know how can i detect the player who has the highest gPlayerKills[ killerid ] In game


Re: How to detect the player who has the highes ect ... [+Rep if you help me] - Jefff - 30.12.2011

pawn Код:
new array[2];
for(new d,g=GetMaxPlayers(); d < g; d++)
    if(IsPlayerConnected(d))
        if(gPlayerKills[ d ] > array[0]) {
            array[0] = gPlayerKills[ d ];
            array[1] = d;
        }
new str[128],Nick[24];
GetPlayerName(array[1],Nick,24);
format(str,sizeof(str),"Best Killer: %s (ID: %d) - %d Kills",Nick,array[1],array[0]);