SA-MP Forums Archive
error 035: argument type mismatch (argument 1) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 035: argument type mismatch (argument 1) (/showthread.php?tid=292146)



error 035: argument type mismatch (argument 1) - SkyWinder - 22.10.2011

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



Re: error 035: argument type mismatch (argument 1) - [HiC]TheKiller - 22.10.2011

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))