argument type mismatch (argument 1)?
#1

pawn Код:
CMD:createbusiness(playerid, params[])
{
    if(GetAdminLevel(playerid) >= 5)
    {
        new BizName[40], Float:BizIntX, Float:BizIntY, Float:BizIntZ, Float:BizExtX, Float:BizExtY, Float:BizExtZ, BizPrice, BizInt;
        if(sscanf(params, "s[40]fffdd", BizName, BizIntX, BizIntY, BizIntZ, BizInt, BizPrice)) return SendClientMessage(playerid, COLOR_RED, "Error: "COL_WHITE"/createbusiness [Name] [IntX] [IntY] [IntZ] [Interior] [Price]");
        GetPlayerPos(playerid, BizExtX, BizExtY, BizExtZ);
        CreateBusiness(BizName, BizPrice, BizIntX, BizIntY, BizIntZ, BizExtX, BizExtY, BizExtZ, BizInt);
    }
    return true;
}
And the stock:
pawn Код:
CreateBusiness(BizName, BizPrice, Float:BizIntX, Float:BizIntY, Float:BizIntZ, Float:BizExtX, Float:BizExtY, Float:BizExtZ, BizInt)
{
    format(GlobalQuery, sizeof(GlobalQuery), "INSERT INTO `businesses` (Name, IntX, IntY, IntZ, ExtX, ExtY, ExtZ, Interior, Price) VALUES ('%s', %f, %f, %f, %f, %f, %f, %d, %d)", BizName, BizIntX, BizIntY, BizIntZ, BizExtX, BizExtY, BizExtZ, BizInt, BizPrice);
    mysql_function_query(MySQLConnection, GlobalQuery, true, "BusinessSQLID", "");
    return true;
}
In the command I'm saving it as a string so I'm not declaring it as an int. On the wiki it says: " An argument passed to a function is of the wrong 'type'. For example, passing a string where you should be passing an integer." But I'm not.
Reply
#2

You function should be like this:
Quote:

CreateBusiness(BizName[], BizPrice, Float:BizIntX, Float:BizIntY, Float:BizIntZ, Float:BizExtX, Float:BizExtY, Float:BizExtZ, BizInt)

Reply
#3

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
You function should be like this:
Thank you!
I was struggling to find the solution haha.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)