How to detect the player who has the highes ect ... [+Rep if you help me]
#1

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
Reply
#2

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]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)