420|0.0|0.0|0.0|0.0|-1|-1|255|0
567,2217.1907,-1157.1108,25.5951,91.0856,88,64
Originally Posted by FS}Nameless [LDR
]
do you have a loading function for the .cfg file? |
public LoadDynamicCars()
{
new arrCoords[9][64];
new strFromFile2[128];
new File: file = fopen("CRP_Scriptfiles/Cars/carspawns.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(DynamicCars))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
DynamicCars[idx][CarModel] = strval(arrCoords[0]);
DynamicCars[idx][CarX] = floatstr(arrCoords[1]);
DynamicCars[idx][CarY] = floatstr(arrCoords[2]);
DynamicCars[idx][CarZ] = floatstr(arrCoords[3]);
DynamicCars[idx][CarAngle] = floatstr(arrCoords[4]);
DynamicCars[idx][CarColor1] = strval(arrCoords[5]);
DynamicCars[idx][CarColor2] = strval(arrCoords[6]);
DynamicCars[idx][FactionCar] = strval(arrCoords[7]);
DynamicCars[idx][CarType] = strval(arrCoords[8]);
new vehicleid = CreateVehicle(DynamicCars[idx][CarModel],DynamicCars[idx][CarX],DynamicCars[idx][CarY],DynamicCars[idx][CarZ],DynamicCars[idx][CarAngle],DynamicCars[idx][CarColor1],DynamicCars[idx][CarColor2], -1);
if(DynamicCars[idx][FactionCar] != 255)
{
SetVehicleNumberPlate(vehicleid, DynamicFactions[DynamicCars[idx][FactionCar]][fName]);
SetVehicleToRespawn(vehicleid);
}
idx++;
}
fclose(file);
}
return 1;
}
Originally Posted by Oxside
Try using dini instead of io, maybe it works. Its possible because it cant read from the file.
Try a print line above and under the io lines. If it prints on the samp-server.exe that part of the code is correct if it doesn't show up you know where the problem is. |