Scriptfiles annoyance
#1

In my scriptfiles (not MySQL yet..) i have Cars.cfg ... In my script I have a line that defines the max vehicle.

If I set that max vehicle over the amount of cars there is, the cars spawn mass amounts, and If I set below, they don't spawn at all.

Will MYSQL solve this problem?
Reply
#2

It sounds more like a problem with your script
Reply
#3

Wrong, because it spawns the exact amount defined.
Reply
#4

can i see the code where you check the file?
Reply
#5

pawn Код:
public LoadCars()
{
  new arrCoords[18][64];
  new strFromFile2[256];
  new File: file = fopen("/settings/cars.cfg", io_read);
  if (file) {
    new idx;
    while (idx < sizeof(CInfo)) {
      fread(file, strFromFile2);
      split(strFromFile2, arrCoords, ',');
      CInfo[idx][cParkx] = floatstr(arrCoords[0]);
      CInfo[idx][cParky] = floatstr(arrCoords[1]);
      CInfo[idx][cParkz] = floatstr(arrCoords[2]);
      CInfo[idx][cParkr] = floatstr(arrCoords[3]);
      strmid(CInfo[idx][cOwner], arrCoords[4], 0, strlen(arrCoords[4]), 255);
      CInfo[idx][cCol1] = strval(arrCoords[5]);
      CInfo[idx][cCol2] = strval(arrCoords[6]);
      CInfo[idx][cMod] = strval(arrCoords[7]);
      CInfo[idx][cValue] = strval(arrCoords[8]);
      CInfo[idx][cBought] = strval(arrCoords[9]);
      strmid(CInfo[idx][cName], arrCoords[10], 0, strlen(arrCoords[10]), 255);
      CInfo[idx][cLevel] = strval(arrCoords[11]);
      CInfo[idx][cAlarm] = strval(arrCoords[12]);
      CInfo[idx][cLaser] = strval(arrCoords[13]);
      CInfo[idx][cGPS] = strval(arrCoords[14]);
      CInfo[idx][cLock] = strval(arrCoords[15]);
      CInfo[idx][cNew] = strval(arrCoords[16]);
      CInfo[idx][cLocked] = strval(arrCoords[17]);
//strmid(CInfo[idx], arrCoords[17], 0, strlen(arrCoords[17]), 255);
      idx++;
    }
  }
  fclose(file);
  return 1;
}
Reply
#6

that looks all good what about the code when you create the cars
Reply
#7

Код:
CreateVehicle(CInfo[c][cMod], CInfo[c][cParkx], CInfo[c][cParky], CInfo[c][cParkz], CInfo[c][cParkr], CInfo[c][cCol1], CInfo[c][cCol2], never);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)