PDA

View Full Version : Bank account


DannySnoopy
10/04/2012, 06:49 PM
hey fellas, i'v made a bank account, which gives you random password and saves, everything works fine
Only when i enter the pass in the Dialog, it says it's incorrect idk why.

here's the dialog

switch( dialogid )
{
case DIALOG_BANKACCOUNT:
{
if( response )
{
new Baccount;
if(Baccount == PlayerInfo[playerid][pBaccount])
{
ShowPlayerDialog( playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{FFFFFF}Bank", "Balance \nWithdraw \nDeposit", "Ok", "Close" );
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Wrong password!");
}
return 1;
}
}

WardenCS
10/04/2012, 06:54 PM
Baccount is defined as nothing? add smth like uhm Baccount = strlen(inputtext);

DannySnoopy
10/04/2012, 06:55 PM
Baccount is defined as nothing? add smth like uhm Baccount = strlen(inputtext);

why inputtext? i have a cmd that you type inside the bank and it gives you random numbers, so basicly you haven't
enter anything.

Ronaldo_raul™
10/04/2012, 06:57 PM
switch( dialogid )
{
case DIALOG_BANKACCOUNT:
{
if( response )
{
new Baccount;
if(strlen(inputtext) == PlayerInfo[playerid][pBaccount])
{
ShowPlayerDialog( playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{FFFFFF}Bank", "Balance \nWithdraw \nDeposit", "Ok", "Close" );
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Wrong password!");
}
return 1;
}
}


Not sure :S

WardenCS
10/04/2012, 06:58 PM
hey fellas, i'v made a bank account, which gives you random password and saves, everything works fine
Only when i enter the pass in the Dialog, it says it's incorrect idk why.


but here you did say that it says the password is wrong

DannySnoopy
10/04/2012, 07:00 PM
switch( dialogid )
{
case DIALOG_BANKACCOUNT:
{
if( response )
{
new Baccount;
if(strlen(inputtext) == PlayerInfo[playerid][pBaccount])
{
ShowPlayerDialog( playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{FFFFFF}Bank", "Balance \nWithdraw \nDeposit", "Ok", "Close" );
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Wrong password!");
}
return 1;
}
}


Not sure :S

nah didn't work

Ronaldo_raul™
10/04/2012, 07:02 PM
nah didn't work

What actually happens ? What is incorrect ? Can you be more specific ?

DannySnoopy
10/04/2012, 07:02 PM
but here you did say that it says the password is wrong

Look, i have a command /bankaccount -> gives you a random pass, and to access you're bank account, you need
to enter the password.

What actually happens ? What is incorrect ? Can you be more specific ?

just gave me wrong pass message.

Ronaldo_raul™
10/04/2012, 07:04 PM
Well, than " PlayerInfo[playerid][pBaccount] " can be wrong. Is that the variable which saves the password. Can show the enums ?

DannySnoopy
10/04/2012, 07:06 PM
Well, than " PlayerInfo[playerid][pBaccount] " can be wrong. Is that the variable which saves the password. Can show the enums ?

enum pInfo
{
pPass,<-
pCash,
pRadio,
pAdmin,
pSex,
pAge,
pLevel,
pTaxi,
pBank,
pSkin,
pTeam,
pNumber,
pBaccount,<-
pLicense,
pRank,
pAccent,
}

Ronaldo_raul™
10/04/2012, 07:09 PM
Is the " pPass " variable that saves the password ?

If yes, than try this -


switch( dialogid )
{
case DIALOG_BANKACCOUNT:
{
if( response )
{
new Baccount;
if(strlen(inputtext) == PlayerInfo[playerid][pPass])
{
ShowPlayerDialog( playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{FFFFFF}Bank", "Balance \nWithdraw \nDeposit", "Ok", "Close" );
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Wrong password!");
}
return 1;
}
}

DannySnoopy
10/04/2012, 07:11 PM
Is the " pPass " variable that saves the password ?

If yes, than try this -


switch( dialogid )
{
case DIALOG_BANKACCOUNT:
{
if( response )
{
new Baccount;
if(strlen(inputtext) == PlayerInfo[playerid][pPass])
{
ShowPlayerDialog( playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{FFFFFF}Bank", "Balance \nWithdraw \nDeposit", "Ok", "Close" );
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Wrong password!");
}
return 1;
}
}


Nononon.

pPass saves the ACCOUNT password.
pBaccount saves the BANK ACCOUNT password.

DannySnoopy
10/04/2012, 07:40 PM
Solved!
For the one who wants to know how.

This is the correct line!
if(strval(inputtext) == PlayerInfo[playerid][pBaccount])