SA-MP Forums Archive
Help! - 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: Help! (/showthread.php?tid=308255)



Help! - Konstantinos - 02.01.2012

Fixed!


Re: Help! - Norck - 02.01.2012

First of all, this is how you can get a value from PVar-string:
pawn Код:
new uname[64];
GetPVarString(playerid,"Username",uname,sizeof(uname)); // now `uname` contains PVar `Username`
And what are you trying to do with this line:
pawn Код:
format(Rstr, sizeof(Rstr), BankFile, GetPVarString(playerid, "Username"));
what's a `BankFile` and what's supposed to be in the Rstr variable?


Re: Help! - Konstantinos - 03.01.2012

Fixed!


Re: Help! - Norck - 03.01.2012

Try this:
pawn Код:
case DIALOG_BANKCREATEPASS:
        {
            if(response) {
                new Rstr[128], name[64], buf[129];
                GetPVarString(playerid, "Username", name, sizeof(name));
             //   format(Rstr, sizeof(Rstr), BankFile, name);
                WP_Hash(buf, sizeof(buf), inputtext);
             //   dini_Set(Rstr, "Password", buf);
                dini_Set(name, "Password", buf);  // I've added this line
                SendClientMessage(playerid, COLOR_GREEN, "You have successfully registered your bank account");
                BankSettings[playerid][BANK_REGISTERED] = 1;
                return ShowPlayerDialog(playerid, DIALOG_BANKSETTINGS, DIALOG_STYLE_LIST, "{FFFF00}Account Settings", "Balance\nWithdraw\nDeposit\nTransfer\nChange Account Password\nDelete Account", "Ok", "Back");
            }
        }



Re: Help! - Konstantinos - 03.01.2012

Quote:
Originally Posted by Norck
Посмотреть сообщение
Try this:
pawn Код:
case DIALOG_BANKCREATEPASS:
        {
            if(response) {
                new Rstr[128], name[64], buf[129];
                GetPVarString(playerid, "Username", name, sizeof(name));
             //   format(Rstr, sizeof(Rstr), BankFile, name);
                WP_Hash(buf, sizeof(buf), inputtext);
             //   dini_Set(Rstr, "Password", buf);
                dini_Set(name, "Password", buf);  // I've added this line
                SendClientMessage(playerid, COLOR_GREEN, "You have successfully registered your bank account");
                BankSettings[playerid][BANK_REGISTERED] = 1;
                return ShowPlayerDialog(playerid, DIALOG_BANKSETTINGS, DIALOG_STYLE_LIST, "{FFFF00}Account Settings", "Balance\nWithdraw\nDeposit\nTransfer\nChange Account Password\nDelete Account", "Ok", "Back");
            }
        }
OMG! Thank you very much Norck. It works awesome with Create Bank Username and Password too.