Loading car spawns from file?
#1

How would I go about loading car spawns from a file like the .txt spawns included in the server?
Reply
#2

well, a small scheme would look like this, I guess

Код:
public OnGameModeInit()
{
  [....]

  LoadVehiclesFromFile();

  [...]
}

stock LoadVehiclesFromFile()
{
  new File: file = fopen("file name", io_read);

  new data[256];
  while (fread(file,data))
  {
     // use something here to split the string into all sorts of smaller strings, usable for extracting data
     // this requires every car to be saved like this >>> model,x,y,z,a,col1,col2
     // so with commas to seperate the different values
     CreateVehicle(model, x, y, z, a, col1, col2);
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)