SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 20/03/2017, 05:35 PM   #1
Kraeror
Huge Clucker
 
Kraeror's Avatar
 
Join Date: Mar 2017
Location: Bulgaria
Posts: 298
Reputation: 13
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 07:44 PM.
Kraeror is offline   Reply With Quote
Old 21/03/2017, 12:23 AM   #2
Amit1998
Huge Clucker
 
Join Date: Sep 2013
Posts: 244
Reputation: 4
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, 08:20 AM   #3
coool
Huge Clucker
 
Join Date: Feb 2013
Location: Pakistan, Sindh
Posts: 450
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--)
__________________
My Writing Works
Lost In Future

coool is offline   Reply With Quote
Old 21/03/2017, 12:33 PM   #4
Kraeror
Huge Clucker
 
Kraeror's Avatar
 
Join Date: Mar 2017
Location: Bulgaria
Posts: 298
Reputation: 13
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 03:08 PM
[help]Can someone sort this out for me??? [A]ndrei Scripting Help 20 27/06/2012 08:25 PM
Can someone sort this out please;3 Elysian` Scripting Help 9 26/06/2012 09:35 PM
how to mak this some sort of help please bally1989 Help Archive 4 18/07/2011 06:37 PM
Help please, sort this out. Learningtoscript Help Archive 0 29/08/2010 01:35 PM


All times are GMT. The time now is 05:26 PM.


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