ATM problem
#1

I have the problem with ATM.

If i use the ATM, want to Deposit/Withdraw money, then it allways gives me 49$ or put on the bank 49$.
Example, i want to deposit on the bank 240$, then it puts only 49$ and says, "You pu the 49$ on the bank".
Can't figure the problem out.

Maybe this code helps:
Код:
	case 4665:
		{
		    if(!response) return 1;
		    else
		    {
		        if(Player[playerid][BankMoney] >= strval(inputtext))
		        {
		            new string[256];
		            Player[playerid][BankMoney] -= strval(inputtext);
		            Player[playerid][Money] += strval(inputtext);
					format(string, sizeof(string), "You have withdrawn $%d from your bank account. New balance: $%d.", inputtext, Player[playerid][BankMoney]);
					SendClientMessage(playerid, WHITE, string);
				}
				else return SendClientMessage(playerid, WHITE, "You don't have that much money in your bank account.");
			}
		}
Reply
#2

pawn Код:
case 4665:
        {
            if(!response) return 1;
            else
            {
                if(Player[playerid][BankMoney] >= strval(inputtext))
                {
                    new string[256];
                    Player[playerid][BankMoney] -= strval(inputtext);
                    Player[playerid][Money] += strval(inputtext);
                    format(string, sizeof(string), "You have withdrawn $%s from your bank account. New balance: $%d.", inputtext, Player[playerid][BankMoney]);
                    SendClientMessage(playerid, WHITE, string);
                }
                else return SendClientMessage(playerid, WHITE, "You don't have that much money in your bank account.");
            }
        }
OR
pawn Код:
case 4665:
        {
            if(!response) return 1;
            else
            {
                if(Player[playerid][BankMoney] >= strval(inputtext))
                {
                    new string[256];
                    Player[playerid][BankMoney] -= strval(inputtext);
                    Player[playerid][Money] += strval(inputtext);
                    format(string, sizeof(string), "You have withdrawn $%d from your bank account. New balance: $%d.", strval(inputtext), Player[playerid][BankMoney]);
                    SendClientMessage(playerid, WHITE, string);
                }
                else return SendClientMessage(playerid, WHITE, "You don't have that much money in your bank account.");
            }
        }
inputtext isn't value, it's string, we always using %s for "1" and we always using %d or %i for 1
Reply
#3

It works great and thanks for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)