Originally Posted by Dayrion
Here we go :
PHP код:
stock ViewFactions(playerid)
{
new string[1040];
for (new i = 0; i != MAX_FACTIONS; i ++) 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(string, sizeof(string),
"Faction ID\tName\tOnline\n\
%sFaction ID: %i\t%s\tN/A\n\
", string, i, FactionData[i][factionName]);
}
Dialog_Show(playerid, FactionsList, DIALOG_STYLE_TABLIST_HEADERS, "AVAILABLE FACTIONS", string, "CANCEL", "");
return 1;
}
to
PHP код:
stock ViewFactions(playerid)
{
new string[1040], string1[1040];
for (new i = 0; i != MAX_FACTIONS; i ++)
{
//format(string, sizeof(string), "Faction ID\tFaction Name\tCurrently Online\n\%sFaction (%i) | %s\n", string, i, FactionData[i][factionName]);
format(string, sizeof(string),"Faction ID: %i\t%s\tN/A\n", i, FactionData[i][factionName]);
strcat(string1, string, sizeof(string1));
}
format(string, sizeof(string), "Faction ID\tFaction Name\tCurrently Online\n%s", string1);
ShowPlayerDialog(playerid, 6542, DIALOG_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. 
|