Way to save dialog inputtext for later use?
#1

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.
Reply
#2

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?
Reply
#3

Use SetPVarString.
Reply
#4

Could you come up with a example, I don't really understand what you mean.
Reply
#5

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.

Reply
#6

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);
    }
Reply
#7

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)

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)