Bank dialog fkd up!!! :O
#1

Hi again

So my bank's have Dialog Menus instead of just /commands. But when i try to deposit or withdraw, the ammounts put into the INPUT box get all messed up.

Example: If I withdraw 1 dollar, it withdraws 49 dollars
if i deposit 1, it deposits 49 and so it shows in chat.

any idea why?



Код:
    if(dialogid == 2 && response) // BANK DIALOG ID 2 WITHDRAW
  	{
    	if(response == 1) {
        if ( inputtext[playerid] > PlayerInfo[playerid][bank]){
        SendClientMessage(playerid,COLOR_BRIGHTRED,"You don't have that much money in your bank account.");
				return 1;
        }
			new ammount;
			ammount=inputtext[playerid];
			PlayerInfo[playerid][bank] = PlayerInfo[playerid][bank]-ammount;
      new balancestring[MAX_STRING],playername[MAX_STRING];
			GetPlayerName(playerid, playername, sizeof(playername));
      format(balancestring,sizeof(balancestring),"You have succesfully withdrawn $%d. Your current balance is $%d dolla!",ammount,PlayerInfo[playerid][bank]);
      SendClientMessage(playerid,COLOR_LIGHTYELLOW,balancestring);
      GivePlayerMoney(playerid, 0+ammount);
      SavePlayer(playerid);
      return 1;

			}else
			BankMenu(playerid);
      return 1;
		}

  
    if(dialogid == 3 && response) // BANK DIALOG ID 3 DEPOSIT
  	{
    	if(response == 1) {
        if ( inputtext[playerid] > GetPlayerMoney(playerid)){
        SendClientMessage(playerid,COLOR_BRIGHTRED,"You need to have that ammount of cash with you in order to deposit.");
				return 1;
        }

			PlayerInfo[playerid][bank] = PlayerInfo[playerid][bank]+(inputtext[playerid]);
      new balancestring[MAX_STRING],playername[MAX_STRING];
			GetPlayerName(playerid, playername, sizeof(playername));
      format(balancestring,sizeof(balancestring),"You have succesfully deposited $%d. Your current balance is $%d dolla!",inputtext[playerid],PlayerInfo[playerid][bank]);
      SendClientMessage(playerid,COLOR_LIGHTYELLOW,balancestring);
      GivePlayerMoney(playerid, 0-inputtext[playerid]);
      SavePlayer(playerid);
      return 1;
        
			}else
			BankMenu(playerid);
      return 1;
		}
Reply
#2

Код:
ammount=inputtext[playerid];
? ? ?
Change it to:
Код:
ammount=inputtext;
Reply
#3

says it must be assigned to an array
Reply
#4

pawn Код:
ammount = strval(inputtext);
Reply
#5

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
ammount = strval(inputtext);
That totally worked! THank you :P
Reply
#6

errrrr
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)