SA-MP Forums Archive
bank problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: bank problem (/showthread.php?tid=308313)



bank problem - Tanush123 - 03.01.2012

How can i update another person bank account if they are online or offline? Well im making bank and for Transfer what do i use to transfer money to another account even if they are offline? I use MYSQL

pawn Код:
if(listitem == 3)
            {
                if(PlayerData[playerid][Bank] < 0)
                {
                    format(str,sizeof(str),"You got {FF0000}$%d {FFFFFF}in your bank account\nEnter the name of the player you want to give your cash to",PlayerData[playerid][Bank]);
                    ShowPlayerDialog(playerid,15,DIALOG_STYLE_LIST,"Transfer",str,"Transfer","Back");
                }
                if(PlayerData[playerid][Bank] > 0)
                {
                    format(str,sizeof(str),"You got {2BD600}$%d {FFFFFF}in your bank account\nEnter the name of the player you want to give your cash to",PlayerData[playerid][Bank]);
                    ShowPlayerDialog(playerid,15,DIALOG_STYLE_LIST,"Transfer",str,"Transfer","Back");
                }
            }



Re: bank problem - coole210 - 03.01.2012

Код:
mysql_real_escape_string(inputtext,inputtext);
format(query,sizeof(query),"SELECT bankAccMoney FROM players WHERE username = '%s'",inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 0)
{
mysql_free_result();
//username doesn't exist, send error msg
}
else
{
mysql_free_result();
//username does exist..
format(query,sizeof(query),"UPDATE players SET bankAccMoney = bankAccMoney + moneyTransferred WHERE username = '%s'",inputtext);
mysql_query(query);
}
rep