Help pls - 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 pls (
/showthread.php?tid=630876)
Help pls -
Kraeror - 19.03.2017
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
?
Re: Help pls -
Mencent - 19.03.2017
Hello!
Can you show us the code, please?
Maybe tell us more information.
Re: Help pls -
Kraeror - 19.03.2017
Yes! I want to sort territories!
Quote:
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
Re: Help pls -
Mencent - 19.03.2017
PHP код:
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;
}
Re: Help pls -
Kraeror - 19.03.2017
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