Sql Lite + sscanf Getting errors.
#1

pawn Код:
CMD:createshopcar(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0;
    new shopid,modelid,cost;
    if (sscanf(params, "iii", shopid,modelid,cost)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/createshopcar <Shop Id | Vehicle Model Id | Cost>\"");
    if (!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, 0xFF0000AA, "You aren't in any car!");
        else
        {
        new
        Query[ 150 ],
        DBResult: Result;
        format(Query, sizeof(Query), "SELECT * FROM `SHOPS` WHERE `ID` = '%i'", DB_Escape(shopid)); // line 40
        Result = db_query(database, Query);
        }
    return 1;
}
errors:
Код:
new.pwn(40) : error 035: argument type mismatch (argument 1)
Thanks for help

line 40 is format line.

all has been set perfectly, this just don't work.
Reply
#2

format(Query, sizeof(Query), "SELECT * FROM `SHOPS` WHERE `ID` = %i",shopid); // line 40
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
format(Query, sizeof(Query), "SELECT * FROM `SHOPS` WHERE `ID` = %i",shopid); // line 40
integers don't need for DB_Escape?
Reply
#4

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
integers don't need for DB_Escape?
No... Only strings
Reply
#5

Quote:
Originally Posted by OPremium
Посмотреть сообщение
No... Only strings
oh, okay. Gotta remmember that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)