[Help] Order Alphabetic a Dialog
#1

Hello guys, how can I alphabetically order a string on a dialog? thx friends +rep

This is my code:

PHP код:
if(IsPlayerInRangeOfPoint(playerid4.0, -118.4777,-1208.6708,4.5859))//F1
    
{
        if(
PRESSED(KEY_SECONDARY_ATTACK))
        {
        if(
Giocatore[playerid][Costruttore]==1) return SendClientMessage(playerid,ROSSO,"[ERROR:] {FFFFFF}You are in builder mode.");
        
format(stringa,sizeof(stringa),"");
        for(new 
i=0;i<=GareCaricatei++)
         {
         if(
Gara[i][Giri]>&& Gara[i][Inseguimento]==0)
         
format(stringa2,sizeof(stringa2),"{F58C5B}{FFFFFF}%s (%d laps)",Gara[i][Nome],Gara[i][Giri]);
         if(
Gara[i][Giri]==&& Gara[i][Inseguimento]==0)
         
format(stringa2,sizeof(stringa2),"{97EA68}{FFFFFF}%s",Gara[i][Nome]);
         if(
Gara[i][Giri]>&& Gara[i][Inseguimento]==1)
         
format(stringa2,sizeof(stringa2),"{446ED1}{FFFFFF}%s (%d laps)",Gara[i][Nome],Gara[i][Giri]);
         if(
Gara[i][Giri]==&& Gara[i][Inseguimento]==1)
         
format(stringa2,sizeof(stringa2),"{446ED1}{FFFFFF}%s",Gara[i][Nome]);
         
strins(stringa,stringa2,strlen(stringa),sizeof(stringa));
         if(
i!=GareCaricate)
         
strins(stringa,"\nAzukay\nEstoril\nForest\nMonaco\n",strlen(stringa),sizeof(stringa));
         }
        
ShowPlayerDialog(playerid2DIALOG_STYLE_LIST"Circuits",stringa "Select""Cancel");
               return 
1;
    }} 
Reply
#2

Check out this include: https://github.com/oscar-broman/md-sort
Reply
#3

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Very thx friend. i got it, but i dont know the way use it alphabetly, could you help me?
Reply
#4

Sort the strings (only if you have strings not single string) and sort them out from lowest argument to highest argument (ASCII chars and indexes).
Reply
#5

Quote:
Originally Posted by antixgaming
Посмотреть сообщение
Sort the strings (only if you have strings not single string) and sort them out from lowest argument to highest argument (ASCII chars and indexes).
antixgaming if you look at it is a creation of circuits and what I try is to alphabetize them every time a new one is created. Thanks for answering but I still do not know how to do it ¿¿??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)