MySQL not loading vehicles
#7

my vehicle system is actually based off of this one too. - Calg00ne beat me.. but mine will use less memory/faster ^^

pawn Код:
stock LoadVehicles()
{
    new result[24], index = 0;
    mysql_query("SELECT * FROM `vehicles` ORDER BY `vehicles`.`CarID` ASC");
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        index++;
        mysql_get_field("CarID", result);
        VehicleSystem[index][CarID] = strval(result);
        mysql_get_field("Model", result);
        VehicleSystem[index][Model] = strval(result);
        mysql_get_field("Locked", result);
        VehicleSystem[index][Locked] = strval(result);
        mysql_get_field("CarX", result);
        VehicleSystem[index][Carx] = floatstr(result);
        mysql_get_field("CarY", result);
        VehicleSystem[index][Cary] = floatstr(result);
        mysql_get_field("CarZ", result);
        VehicleSystem[index][Carz] = floatstr(result);
        mysql_get_field("CarA", result);
        VehicleSystem[index][Cara] = floatstr(result);
        mysql_get_field("Color1", result);
        VehicleSystem[index][Color1] = strval(result);
        mysql_get_field("Color2", result);
        VehicleSystem[index][Color2] = strval(result);
        mysql_get_field("Price", result);
        VehicleSystem[index][Price] = strval(result);
        mysql_get_field("Sell", result);
        VehicleSystem[index][Sell] = strval(result);
        mysql_get_field("Owner", result);
        printf("%s loaded", result);
        strmid(VehicleSystem[index][Owner], result, false, strlen(result), 24);
        new carr = CreateVehicle(VehicleSystem[index][Model],VehicleSystem[index][Carx],VehicleSystem[index][Cary],VehicleSystem[index][Carz]+5,VehicleSystem[index][Cara],VehicleSystem[index][Color1],VehicleSystem[index][Color2],600000);
        IsBuyableCar[carr]=index;
        //SaveMYSQLCarID(carr);
        Globalcarid++;
    }
    mysql_free_result();
    return 1;
}
Reply


Messages In This Thread
MySQL not loading vehicles - by CONTROLA - 08.08.2011, 06:07
Re: MySQL not loading vehicles - by Calgon - 08.08.2011, 06:10
Re: MySQL not loading vehicles - by CONTROLA - 08.08.2011, 06:14
Re: MySQL not loading vehicles - by Calgon - 08.08.2011, 06:18
Re: MySQL not loading vehicles - by CONTROLA - 08.08.2011, 06:22
Re: MySQL not loading vehicles - by Calgon - 08.08.2011, 06:23
Re: MySQL not loading vehicles - by Donya - 08.08.2011, 06:25
Re: MySQL not loading vehicles - by CONTROLA - 08.08.2011, 06:34
Re: MySQL not loading vehicles - by Donya - 08.08.2011, 06:37
Re: MySQL not loading vehicles - by CONTROLA - 08.08.2011, 06:38

Forum Jump:


Users browsing this thread: 1 Guest(s)