Way to save dialog inputtext for later use? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Way to save dialog inputtext for later use? (
/showthread.php?tid=152948)
Way to save dialog inputtext for later use? -
oliverrud - 06.06.2010
Uhm so I'm currently building a bank system for my server, however I can't get any further since I need some way to save the inputtext from one dialog for later use.
Quote:
format(string,128,"UPDATE `bank` SET `Amount`='%s' WHERE `Password`='%s'",inputtext,(somepassword stored thing));
|
The way it works is like this:
/bank enters a dialog where you have to enter a password
if password is correct you will be sat to:
BankData[playerid][bLogged] true;
then when you type /bank again a menu pops up with different stuff like withdraw, deposit and stuff like that.
But my server is not build with anything like ID since that would ruin my bank idea.
I hope someone have a solution for this.
Re: Way to save dialog inputtext for later use? -
oliverrud - 06.06.2010
Isn't it possible to like have a string in a enum data, example:
Quote:
format(string,128,"%s",inputtext);
|
Quote:
BankData[playerid][BankPass] = string;
|
It gives me a error of course but there might be a similar way to fix my problem?
Re: Way to save dialog inputtext for later use? -
Sergei - 06.06.2010
Use SetPVarString.
Re: Way to save dialog inputtext for later use? -
oliverrud - 06.06.2010
Could you come up with a example, I don't really understand what you mean.
Re: Way to save dialog inputtext for later use? -
oliverrud - 06.06.2010
Quick update:
Okay so I did following:
Quote:
if(dialogid == 602 && response)
{
new BankSavePass[128];
format(string,128,"UPDATE `bank` SET `Amount`='%s' WHERE `Password`='%s",inputtext,GetPVarString(playerid," BankSavePass",BankSavePass,12 );
mysql_query(string);
}
|
This is the string I used to store when registering:
Quote:
SetPVarString(playerid,BankSavePass,string);
|
This is the output I get
Quote:
CMySQLHandler::Query(UPDATE `bank` SET `Amount`='453543' WHERE `Password`='') - Successfully executed.
|
Re: Way to save dialog inputtext for later use? -
MadeMan - 06.06.2010
pawn Код:
SetPVarString(playerid,"BankSavePass",string);
pawn Код:
if(dialogid == 602 && response)
{
format(string,128,"UPDATE `bank` SET `Amount`='%s' WHERE `Password`='%s",inputtext,GetPVarString(playerid,"BankSavePass"));
mysql_query(string);
}
Re: Way to save dialog inputtext for later use? -
oliverrud - 06.06.2010
The code you gave me produces me with 2 warnings.
Quote:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
|
Also the mysql query goes kinda berserk with the code.
Quote:
CMySQLHandler::Query(яяяя) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'яяяя' at line 1)
|