21.01.2013, 20:08
pawn Код:
stock LoadDealershipCars()
{
new
file[100],
file2[100],
string[128],
vehicle,
VehicleStatistics[225],
vehicle_dealership[225];
for(new i = 1; i < MAX_VEHICLES; i++)
{
format(file, sizeof(file), "dealerships/vehicles/%d.cfg", i);
if(!fexist(file)) continue;
if(fexist(file) && INI_Open(file))
{
if(GetVehicleModel(i) > 399)
{
for (new v = 1; v < MAX_VEHICLES; v ++)
{
if (GetVehicleModel(v) == 0)
{
i = v;
break;
}
}
format(file2, sizeof(file2), "dealerships/vehicles/%d.cfg", i);
frename(file, file2);
}
VehicleStatistics[i][vehicle_dealership] = INI_ReadInt("vehicle_dealership");
VehicleStatistics[i][vehicle_model] = INI_ReadInt("vehicle_model");
VehicleStatistics[i][vehicle_price] = INI_ReadInt("vehicle_price");
VehicleStatistics[i][vehicle_position][1] = INI_ReadFloat("vehicle_x");
VehicleStatistics[i][vehicle_position][2] = INI_ReadFloat("vehicle_y");
VehicleStatistics[i][vehicle_position][3] = INI_ReadFloat("vehicle_z");
VehicleStatistics[i][vehicle_position][4] = INI_ReadFloat("vehicle_angle");
VehicleStatistics[i][vehicle_onsale] = INI_ReadInt("vehicle_onsale");
vehicle = CreateVehicle(VehicleStatistics[i][vehicle_model], VehicleStatistics[i][vehicle_position][1], VehicleStatistics[i][vehicle_position][2], VehicleStatistics[i][vehicle_position][3], VehicleStatistics[i][vehicle_position][4], 0, 0, -1);
format(string, sizeof(string), "{00C3FF}%s On Sale - Price: $%d{00C3FF}", GetVehicleName(vehicle), VehicleStatistics[i][vehicle_price]);
VehicleStatistics[i][vehicle_label] = Create3DTextLabel(string, color_orange, VehicleStatistics[i][vehicle_position][1], VehicleStatistics[i][vehicle_position][2], VehicleStatistics[i][vehicle_position][3], 10.0, 0);
INI_Close();
}
}
return 1;
}
Try this and post back the last error, if there is one?