SA-MP Forums Archive
Help: error 035: argument type mismatch (argument 2) - 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: Help: error 035: argument type mismatch (argument 2) (/showthread.php?tid=420836)



Help: error 035: argument type mismatch (argument 2) - adampoconnor - 07.03.2013

Hi, I am having an error in PAWN I can not figure out.

I get error 35: argument type mismatch (argument 2)

This is the line the error is on:

pawn Код:
User_Register(playerid, sqlpw);

This is my User_Register function:
pawn Код:
public User_Register(playerid, sqlpw)
{
    new query[200], name[MAX_PLAYER_NAME],message[100];
    GetPlayerName(playerid, name,sizeof(name));
    format(query, sizeof(query), "INSERT INTO playerdata (name, password, cash, admin) VALUES('%s', '%s', 10000, 0)", name, sqlpw);
    mysql_query(query);
    format(message,sizeof(message),"Welcome, %s! You have been registered successfully!",name);
    SendClientMessage(playerid,COLOR_YELLOW,message);
    return 1;
}



Re: Help: error 035: argument type mismatch (argument 2) - zDevon - 07.03.2013

Your passwords are stored as strings, but you are passing an integer to the function. And I would highly recommend hashing those passwords.


Re: Help: error 035: argument type mismatch (argument 2) - adampoconnor - 07.03.2013

I am hashing them, as a matter of fact, querypw is the hashed PW. The hash is done under OnDialogResponse with Whirlpool.

Also, what do you mean I am passing an integer? I use the function with the playerid and sqlpw, then the function uploads it to mysql. I don't understand how it works?