SA-MP Forums Archive
[SOLVED]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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]error 035: argument type mismatch (argument 1) (/showthread.php?tid=251722)



[SOLVED]error 035: argument type mismatch (argument 1) - KoczkaHUN - 28.04.2011

Код:
forward GetPlayerID(const name[]);
public GetPlayerID(const name[])
{
    new query[128], tmp[128], DBResult:result;
    format(query, sizeof(query), "SELECT id FROM users WHERE nev = '%s'", DB_Escape(name)); // This line is erroneous
    result = db_query(userdb, query);
    db_get_field_assoc(result, "id", tmp, sizeof(tmp));
    db_free_result(result);
    return strval(tmp);
}
What's the problem with it? I use the same syntax for making query everywhere, and I don't understand the problem.

Solved by removing "const" from name, because DB_Escape() wasn't expected const file type *lol*