PDA

View Full Version : How to detect the player who has the highes ect ... [+Rep if you help me]


Amine_Mejrhirrou
30/12/2011, 05:17 PM
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

Jefff
30/12/2011, 05:23 PM
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]);