15.09.2016, 21:01
I'm wrong ?
This piece of code creating 50 vehicles with the same parameters and avoid player's data load correctly.
PHP код:
for(new i; i < MAX_VEHICLES; i++)
{
new a = DB::Fetch("Vehicle", _, _, _, "`ID` = '%d'", i);
//printf("fetch; %i - %i - %i", fetch_rows_count(), i, a);
if (fetch_rows_count() > 0)
{
vStats[i][vSQLIB] = fetch_row_id();
vStats[i][vID] = fetch_int("VehicleID");
vStats[i][vX] = fetch_float("x");
vStats[i][vY] = fetch_float("y");
vStats[i][vZ] = fetch_float("z");
vStats[i][vColor1] = fetch_int("Color1");
vStats[i][vColor2] = fetch_int("Color2");
vStats[i][vHealth] = fetch_float("Health");
vStats[i][vModel] = fetch_int("Model");
vStats[i][vRespawn] = fetch_int("Respawn");
vStats[i][vZr] = fetch_float("Angle");
fetch_string("Plate", vStats[i][vPlate], 20);
new vehicleid = CreateVehicle(vStats[vehicleid][vModel], vStats[vehicleid][vX], vStats[vehicleid][vY], vStats[vehicleid][vZ], vStats[vehicleid][vZr], vStats[vehicleid][vColor1], vStats[vehicleid][vColor2], vStats[vehicleid][vRespawn]);
SetVehicleHealth(vehicleid, vStats[vehicleid][vHealth]);
SetVehicleNumberPlate(vehicleid, vStats[vehicleid][vPlate]);
}
}