06.06.2016, 01:25
It only prints 131 vehicles, MAX_VEHICLES is SAMP default (1000).
pawn Код:
forward LoadVehicles();
public LoadVehicles()
{
new rows, fields, vehicleid, x;
cache_get_data(rows, fields);
printf("Rows %d", rows); // if the rows are more than the size of the variable, reset the rows to match (to avoid run time error 4)
for(new y; y < rows; y++)
{
x = cache_get_row_int(y, vvid);
VehLModel[x] = cache_get_row_int(y, vVehModel);
VehLColour1[x] = cache_get_row_int(y, vVehColour1);
VehLColour2[x] = cache_get_row_int(y, vVehColour2);
VehLSpawnX[x] = cache_get_row_float(y, vVehSpawnX);
VehLSpawnY[x] = cache_get_row_float(y, vVehSpawnY);
VehLSpawnZ[x] = cache_get_row_float(y, vVehSpawnZ);
VehLSpawnAngle[x] = cache_get_row_float(y, vVehSpawnAngle);
VehLSiren[x] = cache_get_row_int(y, vVehSiren);
vehicleid = CreateVehicle(VehLModel[x], VehLSpawnX[x], VehLSpawnY[x],VehLSpawnZ[x], VehLSpawnAngle[x], VehLColour1[x], VehLColour2[x], -1, VehLSiren[x]);
VehicleSQLID[vehicleid] = x;//ERROR LINE ERROR LINE ERROR LINE
printf("vehicleid %d", vehicleid);