Jump to content
  • 0

Intrebare


Viorel

Question

am si eu o problema am pus niste masini in cars.cfg dar nu mi le citeste pe sv , adica nu imi apar nu imi spawneaza masina

am pus load

public LoadCar()
{
	new arrCoords[13][64];
	new strFromFile2[256];
	new File: file = fopen("cars.cfg", io_read);
	if (file)
	{
		new idx = 1;
		while (idx < sizeof(CarInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, ',');
			CarInfo[idx][cModel] = strval(arrCoords[0]);
			CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
			CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
			CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
			CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
			CarInfo[idx][cColorOne] = strval(arrCoords[5]);
			CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
			strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
			strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
			CarInfo[idx][cValue] = strval(arrCoords[9]);
			CarInfo[idx][cLicense] = strval(arrCoords[10]);
			CarInfo[idx][cOwned] = strval(arrCoords[11]);
			CarInfo[idx][cLock] = strval(arrCoords[12]);
			printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
			idx++;
		}
	}
	return 1;
}
iar in cars.cfg
426,2136.066406,-1147.109741,24.308074,45.536212,-1,-1,Dealership,Premier,50000,,0,0
426,2136.342773,-1142.129638,24.845478,47.008613,-1,-1,Dealership,Premier,50000,,0,0
426,2136.207519,-1137.549072,25.332399,46.329101,-1,-1,Dealership,Premier,50000,,0,0
426,2136.213623,-1132.720581,25.431499,45.670898,-1,-1,Dealership,Premier,50000,,0,0
426,2118.550537,-1148.575195,24.124799,302.684814,-1,-1,Dealership,Premier,50000,,0,0
426,2118.054931,-1144.129882,24.465200,303.027893,-1,-1,Dealership,Premier,50000,,0,0
426,2118.329101,-1139.004638,24.793920,306.577026,-1,-1,Dealership,Premier,50000,,0,0

de ce oare?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.