01.03.2013, 03:36
pawn Code:
if(dialogid == 3242)
{
if(response)
{
if(strval(inputtext) < 10000 || strval(inputtext) > 99999) return SendClientMessage(playerid, 0xFF0000FF, "Invalid Bank number");
{
format(Query,sizeof(Query), "SELECT `bankno` FROM `bankinfo` WHERE `bankno` = '%d' LIMIT 1", strval(inputtext));
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
ShowPlayerDialog(playerid, 3242, DIALOG_STYLE_INPUT, "Bank of Los Santos - Create New", "Please input a unique Bank Number\n- This will be your account number used for Money Transfers to other users\n\nValid Numbers: 10000 - 99999", "Proceed", "Close");
SendClientMessage(playerid, 0xFF0000AA, "Bank number is already taken");
}
else if(mysql_num_rows() == 0)
{
new Year, Month, Day,regstring[30], Query2[256], Query3[300];
getdate(Year, Month, Day);
format(regstring, sizeof(regstring), "%02d/%02d/%d", Month,Day, Year);
format(Query2,sizeof(Query2), "UPDATE `playerinfo` SET `hasbank` = '1' WHERE `user` = '%s'", escpname(playerid));
format(Query3,sizeof(Query3), "INSERT INTO `bankinfo` (`bankno`, `user`, `money`,`accountcreated`, `withdrawed`, `transferred`, `lastdeposit`, `lastwithdraw`, `lasttransfer`, `lastransferplayer`, `moneyreceivedfrom`, `moneyreceiveddate, `moneyreceived`, lasttransferamount`, `totaltransfers`) VALUES ('%d', '%s', '0', '%s', 'Never', 'Never', 'Never', 'Never', 'Never', 'Never', 'Never', 'Never', '0', '0', '0')", strval(inputtext), escpname(playerid), regstring);
mysql_query(Query2);
mysql_query(Query3);
new str[128];
mysql_store_result();
ShowPlayerDialog(playerid, 3240, DIALOG_STYLE_LIST, Bank of Los Santos", "Deposit\nWithdraw\nTransfer\nRecent Transactions\n{FF0000}Delete Account", "Select", "Close");
hasbank[playerid] = 1;
mysql_free_result();
}
mysql_free_result();
}
}
}
Here's the line that's supposed to be sending the information.
pawn Code:
format(Query3,sizeof(Query3), "INSERT INTO `bankinfo` (`bankno`, `user`, `money`,`accountcreated`, `withdrawed`, `transferred`, `lastdeposit`, `lastwithdraw`, `lasttransfer`, `lastransferplayer`, `moneyreceivedfrom`, `moneyreceiveddate, `moneyreceived`, lasttransferamount`, `totaltransfers`) VALUES ('%d', '%s', '0', '%s', 'Never', 'Never', 'Never', 'Never', 'Never', 'Never', 'Never', 'Never', '0', '0', '0')", strval(inputtext), escpname(playerid), regstring);