SA-MP Forums Archive
Bank dialog fkd up!!! :O - 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: Bank dialog fkd up!!! :O (/showthread.php?tid=121701)



Bank dialog fkd up!!! :O - aNdReSkKkK - 17.01.2010

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;
		}



Re: Bank dialog fkd up!!! :O - GTAguillaume - 17.01.2010

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



Re: Bank dialog fkd up!!! :O - aNdReSkKkK - 17.01.2010

says it must be assigned to an array


Re: Bank dialog fkd up!!! :O - [HiC]TheKiller - 17.01.2010

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



Re: Bank dialog fkd up!!! :O - aNdReSkKkK - 17.01.2010

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


Re: Bank dialog fkd up!!! :O - xXSurviverXx - 12.02.2010

errrrr