Help with sort please - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with sort please (
/showthread.php?tid=630953)
Help with sort please -
Kraeror - 20.03.2017
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;
}
|
Re: Help with sort please -
Amit1998 - 20.03.2017
for(new gangs = MAX_TEAMS; gangs>0; gangs--)
Re: Help with sort please -
coool - 21.03.2017
Quote:
Originally Posted by Amit1998
for(new gangs = MAX_TEAMS; gangs>0; gangs--)
|
it should be
Quote:
for(new gangs = MAX_TEAMS; gangs>-1; gangs--)
|
Re: Help with sort please -
Kraeror - 21.03.2017
Thank you, but scripter "Jessyy" already helped me!