pawn Код:
public SaveCar()
{
new File: file2;
new stringFile[25];
// new idx;
// while (idx < sizeof(CarInfo))
// {
for(new idx; idx < sizeof(CarInfo); idx++)
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%f|%d|%d|%d|%d|%d|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
CarInfo[idx][tModel],
CarInfo[idx][tLocationx],
CarInfo[idx][tLocationy],
CarInfo[idx][tLocationz],
CarInfo[idx][tAngle],
CarInfo[idx][tColorOne],
CarInfo[idx][tColorTwo],
CarInfo[idx][tOwner],
CarInfo[idx][tOwned],
CarInfo[idx][tLock],
CarInfo[idx][tEngine],
CarInfo[idx][tPaintjob],
CarInfo[idx][tOwnable],
CarInfo[idx][tFaction],
CarInfo[idx][tVIP],
CarInfo[idx][tAlarm],
CarInfo[idx][tAlarmStarted],
CarInfo[idx][tTrunkOpened],
CarInfo[idx][tInsured],
CarInfo[idx][tGun1],
CarInfo[idx][tGun2],
CarInfo[idx][tArmor],
CarInfo[idx][tCrack],
CarInfo[idx][tPot],
CarInfo[idx][tNOS],
CarInfo[idx][tHoodOpened],
CarInfo[idx][tPrice],
CarInfo[idx][tLicensePlate],
CarInfo[idx][tDisabled],
CarInfo[idx][tGang],
CarInfo[idx][tVehRemote],
CarInfo[idx][tGPS],
CarInfo[idx][tNeon],
CarInfo[idx][tNeonON],
CarInfo[idx][tComponent0],
CarInfo[idx][tComponent1],
CarInfo[idx][tComponent2],
CarInfo[idx][tComponent3],
CarInfo[idx][tComponent4],
CarInfo[idx][tComponent5],
CarInfo[idx][tComponent6],
CarInfo[idx][tComponent7],
CarInfo[idx][tComponent8],
CarInfo[idx][tComponent9],
CarInfo[idx][tComponent10],
CarInfo[idx][tComponent11],
CarInfo[idx][tComponent12],
CarInfo[idx][tComponent13],
CarInfo[idx][tDuplicateKeys],
CarInfo[idx][tTowServices],
CarInfo[idx][tImp],
CarInfo[idx][tImpPrice],
CarInfo[idx][tRentable],
CarInfo[idx][Neon],
CarInfo[idx][NeonObject]);
format(stringFile, sizeof(stringFile), "Cars/car_%d.ini", idx);
if(fexist(stringFile))
{
file2 = fopen(stringFile, io_write);
fwrite(file2, coordsstring);
fclose(file2);
}
// if(idx == 0)
// {
// file2 = fopen("Ownership/Veh.ini", io_write);
//}
//else
//{
// file2 = fopen("Ownership/Veh.ini", io_append);
// }
//fwrite(file2, coordsstring);
//idx++;
//fclose(file2);
}
return 1;
}