Can someone tell me what's wrong with this ?
#1

pawn Код:
stock AddVehicle(Carid, Carmodel, Carcolor1, Carcolor2, Float:Carx, Float:Cary, Float:Carz, Float:Cara, CarCost, CarSell)
{
    new data[256], query[400];
    format(query, sizeof(query), "SELECT * FROM `vehicles` WHERE CarID = '%d';", Carid);
    mysql_query(query);
    mysql_store_result();

    if(mysql_num_rows() > 0)
    {
        mysql_fetch_field("CarID", data);
        VehicleSystem[Carid][CarID] = strval(data);
       
        mysql_fetch_field("Model", data);
        VehicleSystem[Carid][Model] = strval(data);
       
        mysql_fetch_field("Locked", data);
        VehicleSystem[Carid][Locked] = strval(data);
       
        mysql_fetch_field("CarX", data);
        VehicleSystem[Carid][CarX] = strval(data);
       
        mysql_fetch_field("CarY", data);
        VehicleSystem[Carid][CarY] = strval(data);
       
        mysql_fetch_field("CarZ",data);
        VehicleSystem[Carid][CarZ]=strval(data);
       
        mysql_fetch_field("CarA",data);
        VehicleSystem[Carid][CarA]=strval(data);
       
        mysql_fetch_field("Color1",data);
        VehicleSystem[Carid][Color1]=strval(data);
       
        mysql_fetch_field("Color2",data);
        VehicleSystem[Carid][Color2]=strval(data);
       
        mysql_fetch_field("Price",data);
        VehicleSystem[Carid][Price]=strval(data);
       
        mysql_fetch_field("Sell",data);
        VehicleSystem[Carid][Sell]=strval(data);
       
        mysql_fetch_field("Owner",data);
        strmid(VehicleSystem[Carid][Owner],data,0,20,20);

        new carr = CreateVehicle(VehicleSystem[Carid][Model],VehicleSystem[Carid][Carx],VehicleSystem[Carid][Cary],VehicleSystem[Carid][Carz]+5,VehicleSystem[Carid][Cara],VehicleSystem[Carid][Color1],VehicleSystem[Carid][Color2],600000);
        IsBuyableCar[carr]=Carid;
    }

    else
    {
        printf("");
        printf(" ::::::::::::::::::::::: Car Created :::::::::::::::::::::::");
        printf("");

        VehicleSystem[Carid][CarID] = Carid;
        VehicleSystem[Carid][Model] = Carmodel;
        VehicleSystem[Carid][Locked] = 0;
        VehicleSystem[Carid][CarX] = CarX;
        VehicleSystem[Carid][CarY] = CarY;
        VehicleSystem[Carid][CarZ] = CarZ;
        VehicleSystem[Carid][CarA] = CarA;
        VehicleSystem[Carid][Color1] = Carcolor1;
        VehicleSystem[Carid][Color2] = Carcolor2;
        VehicleSystem[Carid][Price] = CarCost;
        VehicleSystem[Carid][Sell] = CarSell;
        strmid(VehicleSystem[Carid][Owner], "Unbought", 0, 20, 20);

        format(query, sizeof(query),"INSERT INTO `vehicles` (`CarID` ,`Model` ,`Locked` ,`CarX` ,`CarY` ,`CarZ` ,`CarA` ,`Color1` ,`Color2` ,`Price` ,`Sell` ,`Owner`) VALUES ('%d',  '%d',  '0',  '%f',  '%f',  '%f',  '%f',  '%d',  '%d',  '%d', '%d', 'Unbought');",Carid, Carmodel, Carx, Cary, Carz, Cara, Carcolor1, Carcolor2, CarCost, CarSell);
        mysql_query(query);

        new Carr = CreateVehicle(VehicleSystem[Carid][Model], VehicleSystem[Carid][CarX], VehicleSystem[Carid][CarY], VehicleSystem[Carid][CarZ] + 5, VehicleSystem[Carid][CarA], VehicleSystem[Carid][Color1], VehicleSystem[Carid][Color2], 600000);
        IsBuyableCar[Carr] = Carid;

    }
    mysql_free_result();
    return 1;
}
It just gives me a bunch of errors just check if there's something incorrect so i can fix it, otherwise i will post the errors.
Reply


Messages In This Thread
Can someone tell me what's wrong with this ? - by Glint - 29.09.2012, 06:06
Re: Can someone tell me what's wrong with this ? - by XtremeR - 29.09.2012, 06:16
Re: Can someone tell me what's wrong with this ? - by Glint - 29.09.2012, 06:17
Re: Can someone tell me what's wrong with this ? - by zombieking - 29.09.2012, 07:54
Re: Can someone tell me what's wrong with this ? - by Glint - 29.09.2012, 08:14

Forum Jump:


Users browsing this thread: 2 Guest(s)