error 035: argument type mismatch (argument 1)
#1

I am getting this error on the line

pawn Код:
if(IsNumeric(fare))

the IsNumeric function i use is

pawn Код:
stock IsNumeric(const string[])
{
        for (new i = 0, j = strlen(string); i < j; i++)
        {
                if (string[i] > '9' || string[i] < '0') return 0;
        }
        return 1;
}
pawn Код:
if(AccountGetInt(PName,"Job") == 2)
            {
                new fare;
                fare = strval(inputtext);
                if(IsNumeric(fare))
                {
                    new string[50];
                    if(fare < 0) return ShowPlayerDialog(playerid,8000,DIALOG_STYLE_INPUT,"SET FARE","Fare cannot be lower than $0\n\nSet your fare(0 - 1000):","Set Fare","Cancel");
                    if(fare < 1000) return ShowPlayerDialog(playerid,8000,DIALOG_STYLE_INPUT,"SET FARE","Fare cannot be higher than $1000\n\nSet your fare(0 - 1000):","Set Fare","Cancel");
                    if(fare >= 0 && fare <= 1000)
                    {
                        AccountSetInt(PName,"DFare",fare);
                        format(string, sizeof(string), "You have set your fare rate at $%d", fare);
                        SendClientMessage(playerid, COLOR_TAXI, string);
                        TogglePlayerControllable(playerid,1);
                    }
                } else return ShowPlayerDialog(playerid,8000,DIALOG_STYLE_INPUT,"SET FARE","Set your fare(0 - 1000):","Set Fare","Cancel");
            }
Reply
#2

pawn Код:
stock IsNumeric(const string[])
It has to be a string as the input. You can just use inputtext for the IsNumeric function then use fare for the rest of your code.

pawn Код:
if(IsNumeric(fare))
//To
if(IsNumeric(inputtext))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)