You have to sort.
Example (not same scenario)
Spoiler
may have some errors since was copy paste from a snippet
PHP Code:
public void GetQueue()
{
int specs[MAXPLAYERS+1][2];
for (int client = 1; client <= MaxClients; client++)
{
specs[client][0] = client;
if (!IsClientInGame(client))
continue;
if (IsFakeClient(client))
continue;
if (GetClientTeam(client) != 1)
continue;
specs[client][1] = RoundFloat(GetClientTime(client));
}
SortCustom2D(specs, sizeof(specs), CustomCompare);
char buffer[250];
for (int i = 0; i < MaxClients; i++)
{
if (specs[i][1] == 0)
continue;
if (!IsClientInGame(specs[i][0]))
continue;
if (buffer[0] == 0)
FormatEx(buffer, sizeof(buffer), "%N", specs[i][0]);
else
Format(buffer, sizeof(buffer), "%s, %N", buffer, specs[i][0]);
}
PrintToChatAll(buffer);
}
public int CustomCompare(int[] elem1, int[] elem2, const int[][] array, Handle hndl)
{
if (elem2[1] == 0)
return -1;
if (elem1[1] > elem2[1])
return -1;
if (elem1[1] < elem2[1])
return 1;
return 0;
}
Probably has other ways to do it, is an old code I did a long time ago to sort specs
__________________