11.04.2013, 21:37
Did a extensive search on the forums, most posts were from earlier versions and did not help. I am using BlueG's R8 Mysql Plugin (r14).
Here is how I am loading the banks:
I have a feeling I am doing it way wrong, and I am guessing I do not even need to create new variables for each different row, but it was the only thing I could think of doing.
Basically what this does is you can create multiple bank accounts and I am trying to have it so it loads them all when you connect.
Here is how I am loading the banks:
pawn Код:
public thread_loadbank(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
cache_get_row(0, 0, bInfo[playerid][bOwner], connectionHandle, 24);
cache_get_row(0, 1, bInfo[playerid][bNickname], connectionHandle, 50);
bInfo[playerid][bAccountNumber] = cache_get_row_int(0, 2, connectionHandle);
bInfo[playerid][bPin] = cache_get_row_int(0, 3, connectionHandle);
bInfo[playerid][bType] = cache_get_row_int(0, 4, connectionHandle);
cache_get_row(0, 5, bInfo[playerid][bCorp], connectionHandle, 50);
bInfo[playerid][bMoney] = cache_get_row_int(0, 6, connectionHandle);
bInfo[playerid][bMaxWithdraw] = cache_get_row_int(0, 7, connectionHandle);
cache_get_row(1, 0, bInfo2[playerid][bOwner], connectionHandle, 24);
cache_get_row(1, 1, bInfo2[playerid][bNickname], connectionHandle, 50);
bInfo2[playerid][bAccountNumber] = cache_get_row_int(1, 2, connectionHandle);
bInfo2[playerid][bPin] = cache_get_row_int(1, 3, connectionHandle);
bInfo2[playerid][bType] = cache_get_row_int(1, 4, connectionHandle);
cache_get_row(1, 5, bInfo2[playerid][bCorp], connectionHandle, 50);
bInfo2[playerid][bMoney] = cache_get_row_int(1, 6, connectionHandle);
bInfo2[playerid][bMaxWithdraw] = cache_get_row_int(1, 7, connectionHandle);
// MORE CODE DOWN HERE HOWEVER MY MAIN QUESTION IS ABOVE
Basically what this does is you can create multiple bank accounts and I am trying to have it so it loads them all when you connect.