SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/03/2017, 04:35 PM   #1
Kraeror
Little Clucker
 
Join Date: Mar 2017
Posts: 13
Reputation: 0
Smile Help with sort please

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;
}

Last edited by Kraeror; 20/03/2017 at 06:44 PM.
Kraeror is online now   Reply With Quote
Old 20/03/2017, 11:23 PM   #2
Amit1998
Huge Clucker
 
Join Date: Sep 2013
Posts: 213
Reputation: 3
Default Re: Help with sort please

for(new gangs = MAX_TEAMS; gangs>0; gangs--)
__________________
+REP me if I helped you !
Amit1998 is offline   Reply With Quote
Old 21/03/2017, 07:20 AM   #3
coool
Big Clucker
 
Join Date: Feb 2013
Posts: 168
Reputation: 5
Default Re: Help with sort please

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--)
__________________
Hey there I am here to write amazing lines for you so PM me if you are not good at writing.
My Writing Works
Lost In Future
coool is offline   Reply With Quote
Old 21/03/2017, 11:33 AM   #4
Kraeror
Little Clucker
 
Join Date: Mar 2017
Posts: 13
Reputation: 0
Default Re: Help with sort please

Thank you, but scripter "Jessyy" already helped me!
Kraeror is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Am I on some sort of blacklist? NicholasA Everything and Nothing 2 01/04/2013 02:08 PM
[help]Can someone sort this out for me??? [A]ndrei Scripting Help 20 27/06/2012 07:25 PM
Can someone sort this out please;3 Elysian` Scripting Help 9 26/06/2012 08:35 PM
how to mak this some sort of help please bally1989 Help Archive 4 18/07/2011 05:37 PM
Help please, sort this out. Learningtoscript Help Archive 0 29/08/2010 12:35 PM


All times are GMT. The time now is 06:00 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.