17.01.2010, 21:10

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