Doesn't insert data.
#6

I modified it again:
pawn Код:
CMD:createhouse(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        new Float:IX, Float:IY, Float:IZ, Float:EX, Float:EY, Float:EZ, interior, price, locked;
        if(sscanf(params, "fffdd", IX, IY, IZ, interior, price)) return SendClientMessage(playerid, COLOR_ORANGE, "/createhouse [Interior X], [Interior Y], [Interior Z], interiorID, price");
        GetPlayerPos(playerid, EX, EY, EZ);
        new houseid = -1;

        for(new i = 1; i < MAX_HOUSES; i++)
        {
            if(HouseInfo[i][EPosX] == 1)
            {
                houseid = i;
                break;
            }
        }
        format(String, sizeof(String), "INSERT INTO houses (price, EPosX, EPosY, EPosZ, IPosX, IPosY, IPosZ, Interior, Locked) VALUES");
        format(String, sizeof(String), "%s (%d, %f, %f, %f, %f, %f, %f, %d, '1')", String, price, EX, EY, EZ, IX, IY, IZ, interior, locked);
        mysql_query(String);

        SendClientMessage(playerid, COLOR_WHITE, "House created!");

        HouseInfo[houseid][HID] = mysql_insert_id();
        HouseInfo[houseid][Price] = price;
        HouseInfo[houseid][EPosX] = EX;
        HouseInfo[houseid][EPosY] = EY;
        HouseInfo[houseid][EPosZ] = EZ;
        HouseInfo[houseid][IPosX] = IX;
        HouseInfo[houseid][IPosY] = IY;
        HouseInfo[houseid][IPosZ] = IZ;
        HouseInfo[houseid][Interior] = interior;
        HouseInfo[houseid][Locked] = locked;
       
        //CreatePickup(1273, 1, hexteriorX, hexteriorY, hexteriorZ, -1);
        //Create3DTextLabel("[House]\nNot owned", COLOR_ORANGE, hexteriorX, hexteriorY, hexteriorZ, 40.0, 0, 0);
    }
    return true;
}
This is what the table returns.
(Number 4)
Reply


Messages In This Thread
Doesn't insert data. - by Binx - 06.04.2014, 16:20
Re: Doesn't insert data. - by Corekt - 06.04.2014, 16:26
Re: Doesn't insert data. - by Konstantinos - 06.04.2014, 16:27
Re: Doesn't insert data. - by Binx - 06.04.2014, 16:43
Re: Doesn't insert data. - by Konstantinos - 06.04.2014, 16:50
Re: Doesn't insert data. - by Binx - 06.04.2014, 16:53
Re: Doesn't insert data. - by Konstantinos - 06.04.2014, 16:59
Re: Doesn't insert data. - by Binx - 06.04.2014, 17:07
Re: Doesn't insert data. - by Konstantinos - 06.04.2014, 17:42
Re: Doesn't insert data. - by Binx - 06.04.2014, 17:50

Forum Jump:


Users browsing this thread: 3 Guest(s)