Help with sort please
#1

Can you sort territories in descending order?
Here is the code:
Quote:

if(strcmp(cmd, "/territories", true) == 0)
{
new TerritoryString[2560];
for(new gangs=0; gangs < MAX_TEAMS; gangs++)
{
format(TerritoryString, sizeof(TerritoryString), "%s%s owns %d territories.\n",TerritoryString,TeamInfo[gangs][TeamName],TeamInfo[gangs][TerritoriesWon]);
}
ShowPlayerDialog(playerid,384,DIALOG_STYLE_MSGBOX, "Territories:", TerritoryString, "OK", "");
return 1;
}

Reply
#2

for(new gangs = MAX_TEAMS; gangs>0; gangs--)
Reply
#3

Quote:
Originally Posted by Amit1998
View Post
for(new gangs = MAX_TEAMS; gangs>0; gangs--)
it should be
Quote:

for(new gangs = MAX_TEAMS; gangs>-1; gangs--)

Reply
#4

Thank you, but scripter "Jessyy" already helped me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)