06.03.2010, 11:37
This will just find the largest score, like you're trying to do
And this will give you the index of the gang with the highest score (maxi)
pawn Код:
if(strcmp("/toplist", cmd, true) == 0)
{
new max = GangInfo[0][gangScore];
for(new i = 0; i < MAX_GANGS; i++)
{
if(GangInfo[i][gangScore] > max)
{
max = GangInfo[i][gangScore];
}
}
format(string, sizeof(string), "%d", max);
SendClientMessageToAll(rot,string);
}
pawn Код:
if(strcmp("/toplist", cmd, true) == 0)
{
new max = GangInfo[0][gangScore];
new maxi;
for(new i = 0; i < MAX_GANGS; i++)
{
if(GangInfo[i][gangScore] > max)
{
max = GangInfo[i][gangScore];
maxi = i;
}
}
format(string, sizeof(string), "%d", GangInfo[maxi][gangScore]);
SendClientMessageToAll(rot,string);
}