strlen inputtext not working properly?
#1

pawn Код:
else if(strlen(inputtext) < BankInfo[playerid][pBankMoney][0])
            {
                if(BankInfo[playerid][pActiveAcc][0] == 1)
                {
                new withdrawd = strlen(inputtext);
                GivePlayerMoney(playerid, withdrawd);
                format(string, sizeof(string), "You have withdrawn $%d from Bank Account 1.", withdrawd);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                BankInfo[playerid][pBankMoney][0] -= withdrawd;
                }
                else SendClientMessage(playerid, COLOR_LIGHTRED, "That account is not active and valid, you cannot withdraw from it!");
            }
I have this on my dialog response but say I withdraw like 5000 it will say I have withdrawn $2? and it will give me the $2 not the 5000

Any help on this? I have no idea why it isn't giving me the full amount, not good with strlen(inputtext)
Reply
#2

It's not working if you try to use just inputtext? without strlen?
Reply
#3

Duh, strlen returns the length of the text (hence string length). Use strval.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Duh, strlen returns the length of the text (hence string length). Use strval.
Worked, thank you.

Rep'd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)