Why wont this work?
#1

pawn Код:
stock LoadCars()
{
    new query[250];
    new VehicleID;
    format(query, sizeof(query), "SELECT * FROM `vehicles` ORDER BY `vehicles`.`Model` ASC LIMIT " #MAX_CARS "");
    mysql_query(query);
    print(query);
    new line[400], sdata[24], data[7], Float:fdata[4];
    mysql_store_result();
    while(mysql_fetch_row(line))
    {
        sscanf(line, "p<|>ddffffds[24]", data[0], data[1], fdata[0], fdata[1], fdata[2], fdata[3], data[2], sdata);
        CarInfo[cars][vID] = data[0];
        CarInfo[cars][vModel] = data[1];
        CarInfo[cars][vX] = fdata[0];
        CarInfo[cars][vY] = fdata[1];
        CarInfo[cars][vZ] = fdata[2];
        CarInfo[cars][vA] = fdata[3];
        CarInfo[cars][vPrice] = data[2];
        strcat(CarInfo[cars][vOwner], sdata, sizeof(sdata));
       
        cars++;
        print(line);
       
        VehicleID = CreateVehicle(CarInfo[cars][vModel], CarInfo[cars][vX], CarInfo[cars][vY], CarInfo[cars][vZ], CarInfo[cars][vA], random(151), random(151), -1);
        printf("X %f, Y %f, Z %f, A %f", CarInfo[cars][vX], CarInfo[cars][vY], CarInfo[cars][vZ], CarInfo[cars][vA]);
        CreateRandomNumberPlate(VehicleID);
    }
    printf("Loaded Vehicles: %d.", cars);
    mysql_free_result();
    return 1;
}
Updated code.

It just wont load any of the information.
Reply


Messages In This Thread
Why wont this work? - by Luis- - 02.12.2011, 10:16
Re: Why wont this work? - by Luis- - 02.12.2011, 11:41
Re: Why wont this work? - by oliverrud - 02.12.2011, 11:53
Re: Why wont this work? - by Luis- - 02.12.2011, 11:53
Re: Why wont this work? - by [L3th4l] - 02.12.2011, 11:55
Re: Why wont this work? - by Luis- - 02.12.2011, 12:01
Re: Why wont this work? - by Scenario - 02.12.2011, 12:06
Re: Why wont this work? - by Luis- - 02.12.2011, 12:37
Re: Why wont this work? - by Luis- - 02.12.2011, 16:46
Re: Why wont this work? - by Vince - 02.12.2011, 17:12

Forum Jump:


Users browsing this thread: 3 Guest(s)