No, I mean ALL ARRAYS with just one SortCustom. And I meant not the ShortCustom1D, its not possible, I mean another custom function for it. As I said.
PHP Code:
enum PlayerDatas
{
arItemsBought,
arShoots,
arKills,
}
new PlayerData[33][PlayerDatas]
PHP Code:
GetTop(PlayerData[id][arKills])
GetTop(arArray[])
{
new iPlayers[32], iPlayersnum, Player;
get_players(iPlayers, iPlayersnum)
for(new i;i < iPlayersnum;i++)
{
Player = iPlayers[i]
SortCustom(Player, iPlayersnum, arArray)
}
return Player[0]
}
SortCustom(elem1, elem2, arArray[])
{
if(arArray[elem1] > arArray[elem2])
return -1
else if(arArray[elem1] < arArray[elem2])
return 1
return 0
}
I want return the player's index that have the most array's size. Example:
PHP Code:
for(new i;i < get_maxplayers();i++)
checkChance(ev_BestKills, GetTop(PlayerData[i][arKills])
the GetTop should return the player's index that have the most kills. You understand ? Because on the checkChance(), the second parameter is the player's index, I have it there:
PHP Code:
if(iIndex)
{
new userName[32]
get_user_name(iIndex, userName, charsmax(userName))
}
__________________