

for(new i=1;i<MAX_SCRIPTVEHICLES+1;i++)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
AddStaticVehicleEx(VehicleInfo[i][vModel],VehicleInfo[i][vLocX],VehicleInfo[i][vLocY],VehicleInfo[i][vLocZ],VehicleInfo[i][vAngle],
VehicleInfo[i][vColorOne],VehicleInfo[i][vColorTwo],3600);
SetVehicleNumberPlate(i,VehicleInfo[i][vPlate]);
SetVehicleToRespawn(i);
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(i,0,0,alarm,doors,bonnet,boot,objective);
}
|
i believe the problem might be in VehicleInfo[i][vPlate].
you better show the code related about ^ . |
vPlate[8]
public SaveVehicles()
{
new idx;
new File: file2;
while (idx < sizeof(VehicleInfo))
{
new coordsstring[512];
format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%d,%s,%d,%d,%s,%d,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s,%d,%d,%d\n",
// I have Hidden the rest as they're not required.
VehicleInfo[idx][vPlate],
if(idx == 0)
{
file2 = fopen("Vehicles/Vehicles.cfg", io_write);
}
else
{
file2 = fopen("Vehicles/Vehicles.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
}
public LoadVehiclesInfo()
{
new arrCoords[28][64];
new strFromFile2[256];
new File: file = fopen("Vehicles/Vehicles.cfg", io_read);
if (file)
{
new idx=0;
while (idx < sizeof(VehicleInfo))
{
fread(file, strFromFile2);
splitcar(strFromFile2, arrCoords, ',');
// Rest of them Hidden again.
strmid(VehicleInfo[idx][vPlate],arrCoords[24],0,strlen(arrCoords[24]),255);
idx++;
}
fclose(file);
}
return 1;
}
if (file)
{
new idx=0;
while (idx < sizeof(VehicleInfo))
{
fread(file, strFromFile2);
splitcar(strFromFile2, arrCoords, ',');
// Rest of them Hidden again.
strmid(VehicleInfo[idx][vPlate],arrCoords[24] ,strlen(arrCoords[24]),255);
idx++;
}
fclose(file);
}
return 1;
}
|
pawn Код:
|