Problem with DIALOG STYLE TABLIST HEADER
#5

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Here we go :
PHP код:
stock ViewFactions(playerid)
{
    new 
string[1040];
    for (new 
0!= MAX_FACTIONS++) if (FactionData[i][factionExists]) {
         
//format(string, sizeof(string), "Faction ID\tFaction Name\tCurrently Online\n\%sFaction (%i) | %s\n", string, i, FactionData[i][factionName]);
         
format(stringsizeof(string),
        
"Faction ID\tName\tOnline\n\
        %sFaction ID: %i\t%s\tN/A\n\
           "
stringiFactionData[i][factionName]);
    }
    
Dialog_Show(playeridFactionsListDIALOG_STYLE_TABLIST_HEADERS"AVAILABLE FACTIONS"string"CANCEL""");
    return 
1;

to

PHP код:
stock ViewFactions(playerid)
{
    new 
string[1040], string1[1040];
    for (new 
0!= MAX_FACTIONS++)
    {
         
//format(string, sizeof(string), "Faction ID\tFaction Name\tCurrently Online\n\%sFaction (%i) | %s\n", string, i, FactionData[i][factionName]);
        
format(stringsizeof(string),"Faction ID: %i\t%s\tN/A\n"iFactionData[i][factionName]);
        
strcat(string1stringsizeof(string1));
    }
    
format(stringsizeof(string), "Faction ID\tFaction Name\tCurrently Online\n%s"string1);
    
ShowPlayerDialog(playerid6542DIALOG_STYLE_TABLIST_HEADERS"AVAILABLE FACTIONS"string"CANCEL""");
    return 
1;

You need Formate all of your strings (lines of your table) in one with strcat. Why after the for (...), put a new format? Because if you put in the loop, it will add like this:
ID Name N/A
0 LSPD N/A
ID Name N/A
1 LFDP N/A [...]

If you have any questions, post them here.
I hope I helped you.
Yes, it is mate, thank you. but you could please tell me how do I count the online members on each faction, in print it in the dialog? where the N/A is
Reply


Messages In This Thread
Problem with DIALOG STYLE TABLIST HEADER - by DemME - 21.05.2016, 01:17
Re: Problem with DIALOG STYLE TABLIST HEADER - by DemME - 21.05.2016, 01:42
Re: Problem with DIALOG STYLE TABLIST HEADER - by Dayrion - 21.05.2016, 02:08
Re: Problem with DIALOG STYLE TABLIST HEADER - by izeatfishz - 21.05.2016, 02:41
Re: Problem with DIALOG STYLE TABLIST HEADER - by DemME - 21.05.2016, 11:14
Re: Problem with DIALOG STYLE TABLIST HEADER - by Dayrion - 21.05.2016, 13:22
Re: Problem with DIALOG STYLE TABLIST HEADER - by DemME - 22.05.2016, 12:55

Forum Jump:


Users browsing this thread: 1 Guest(s)