OnPlayerText problem
#2

You placed your if statement in the wrong order

pawn Код:
if(GetPVarInt(playerid, "DepositingMoney") == 1)
    {
        new b = GetPVarInt(playerid, "BankIDSlot");
        if(IsNumeric(text))
        {
            if(GetPlayerMoney(playerid) >= strval(text)) // Here :P
            {
                GivePlayerMoney(playerid, -strval(text));
                PlayerInfo[playerid][pCash] -= strval(text);
                format(szMessage, sizeof(szMessage), "* You have deposited $%d into the account.", strval(text));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, szMessage);
                DeletePVar(playerid, "DepositingMoney");
                BankData[playerid][b][bMoney] += strval(text);
            }
            else SendClientMessage(playerid, COLOR_GREY, "* You do not have that much to deposit!"); DeletePVar(playerid, "DepositingMoney");
        }
        else SendClientMessage(playerid, COLOR_WHITE, "* You did not enter a number!"); DeletePVar(playerid, "DepositingMoney");
    }
Reply


Messages In This Thread
OnPlayerText problem - by MattSlater - 31.01.2013, 23:40
Respuesta: OnPlayerText problem - by OPremium - 01.02.2013, 00:34

Forum Jump:


Users browsing this thread: 1 Guest(s)