PDA

View Full Version : Help pls


Kraeror
19/03/2017, 04:35 PM
Hello! How i can sort my territories in dialog like this:

Grove Street Families: 13 territories
Rollin Hights Ballas: 5 territories
Los Santos Vagos: 3 territories
?

Mencent
19/03/2017, 06:09 PM
Hello!

Can you show us the code, please?
Maybe tell us more information. ;)

Kraeror
19/03/2017, 06:30 PM
Yes! I want to sort territories!
if(strcmp(cmd, "/territories", true) == 0)
{
for(new gangs=0; gangs < MAX_TEAMS; gangs++)
{
format(string, sizeof(string), "%s owns %d territories.",TeamInfo[gangs][TeamName],TeamInfo[gangs][TurfWarsWon]);
ShowPlayerDialog(playerid,384,DIALOG_STYLE_MSGBOX, "Territories:", string, "OK", "");
}
return 1;
}
And i want this ^ output to be like this:
Grove Street Families owns 35 territories
Ballas owns 28 territories
Vagos owns 3 territories
Rifa owns 2 territories

Mencent
19/03/2017, 06:38 PM
if(strcmp(cmd, "/territories", true) == 0)
{
for(new gangs=0; gangs < MAX_TEAMS; gangs++)
{
format(string, sizeof(string), "%s%s owns %d territories.\n",string,TeamInfo[gangs][TeamName],TeamInfo[gangs][TurfWarsWon]);
}
ShowPlayerDialog(playerid,384,DIALOG_STYLE_MSGBOX, "Territories:", string, "OK", "");
return 1;
}

Kraeror
19/03/2017, 06:43 PM
I want to be sorted in ascending order like this:
Grove Street Families owns 35 territories
Ballas owns 28 territories
Vagos owns 3 territories
Rifa owns 2 territories