03.11.2013, 09:40
Basically the master account names aren't showing in the dialog.
pawn Код:
stock LoadCharacterAccounts(playerid)
{
new count = 0,CharacterName[MAX_PLAYER_NAME];
format(MasterAccounts[playerid][CharacterString], 128,"");
format(Query,sizeof(Query),"SELECT * FROM `characters` WHERE `MasterID` = '%d'",MasterAccounts[playerid][MasterAccountID]);
mysql_query(Query);
count = mysql_num_rows();
if(count == 0)
{
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_LIST, "Your Characters", "None to load, create one on the ucp", "", "Quit");
}
for(new a; a < count; a++)
{
mysql_fetch_field_row(CharacterName,"username");
format(MasterAccounts[playerid][CharacterString], 128, "%s\n%s", MasterAccounts[playerid][CharacterString], CharacterName);
printf("Character %s ,Owned By %s has been loaded",CharacterInfo[playerid][Character], GetOriginalName(playerid));
}
if(strlen(MasterAccounts[playerid][CharacterString]) >= 1) { ShowPlayerDialog(playerid, 200, DIALOG_STYLE_LIST, "Your Characters", MasterAccounts[playerid][CharacterString], "Select", "Quit"); }
mysql_free_result();
return 1;
}