22.09.2012, 19:55
What i basically am trying to figure out is i have a variable pCookies under my pInfo enum and i want to somehow find a way to get the 5 players,who have the highest ammount of cookies.
stock GetPlayerWithMostCookies( )
{
new iRecord = 0;
new iChoosenPlayer = MAX_PLAYERS + 1;
foreach(Player, i) {
if ( cookies[i] > iRecord ){
iRecord = cookies[i];
iChoosenPlayer = i;
}
}
return iChoosenPlayer;
}