09.02.2014, 16:17
I'm trying to show player's banks, but also on top "Create Bank" and "Remove Bank", problem is, it doubles, how do i fix it?
Code:
Image:
Please DO NOT post if you haven't got any experience with this!
Code:
pawn Код:
public ShowBankAccounts(playerid)
{
new query[512],results[400],title[64];
format(title,sizeof(title),"{1B8AE4}Your Bank Accounts");
Num1[playerid] = 0;
Num2[playerid] = 12;
format(query,sizeof(query),"SELECT ID, Name, Balance FROM `bankaccounts` WHERE `Owner`='%s' ORDER BY `ID` DESC LIMIT %d, %d", PlayerName(playerid), Num1[playerid], Num2[playerid]);
mysql_query(query);
mysql_store_result();
new tRows = mysql_num_rows();
if(tRows == 0) { SCM(playerid, COLOR_RED, "You do not have any bank accounts!"); return 1; }
new pID, pName[MAX_PLAYER_NAME], bBalance;
while(mysql_fetch_row(query))
{
sscanf(query, "p<|>ds[24]d", pID, pName, bBalance);
format(results,sizeof(results),"Create Bank Account\nRemove Bank Account\n%s%s%d | %s | $%d\n", results,pID,pName,bBalance);
}
mysql_free_result();
ShowPlayerDialog(playerid, mybankaccounts1, DIALOG_STYLE_LIST,title, results,"Select", "Back");
return 1;
}
Please DO NOT post if you haven't got any experience with this!