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
Big Clucker
 
Join Date: Mar 2017
Posts: 98
Reputation: 1
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 offline   Reply With Quote
Old 20/03/2017, 11:23 PM   #2
Amit1998
Huge Clucker
 
Join Date: Sep 2013
Posts: 235
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
Huge Clucker
 
Join Date: Feb 2013
Location: Pakistan, Sindh
Posts: 425
Reputation: 23
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--)
__________________
SCRIPTING ON LOW RATES

My Writing Works
Lost In Future


Code:
Every thing in the world either a potato or not a potato
coool is offline   Reply With Quote
Old 21/03/2017, 11:33 AM   #4
Kraeror
Big Clucker
 
Join Date: Mar 2017
Posts: 98
Reputation: 1
Default Re: Help with sort please

Thank you, but scripter "Jessyy" already helped me!
Kraeror is offline   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 02:30 AM.


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