HELP input line too long - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP input line too long (
/showthread.php?tid=503306)
HELP input line too long -
jeffery30162 - 29.03.2014
I am making a save function for my vehicle system and i get the line too long error.
here is the code
Код:
stock SaveCar()
{
if(!fexist("car.cfg")) fcreate("car.cfg");
new idx = 1, File:file;
new string[500];
while(idx < MAX_CAR)
{
format(string, sizeof(string), "%d|%d|%s|%f|%f|%f|%f|%d|%d|%d|%d|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n", CarInfo[idx][cStatus], CarInfo[idx][cDealership], CarInfo[idx][cOwner], CarInfo[idx][cX], CarInfo[idx][cY], CarInfo[idx][cZ], CarInfo[idx][cAngle], CarInfo[idx][cModel], CarInfo[idx][cColor1], CarInfo[idx][cColor2], CarInfo[idx][cCost], CarInfo[idx][cLicensePlate], CarInfo[idx][cMod1], CarInfo[idx][cMod2], CarInfo[idx][cMod3], CarInfo[idx][cMod4], CarInfo[idx][cMod5], CarInfo[idx][cMod6], CarInfo[idx][cMod7], CarInfo[idx][cMod8], CarInfo[idx][cMod9], CarInfo[idx][cMod10]);
if(idx == 1)
{
file = fopen("car.cfg", io_write);
}
else
{
file = fopen("car.cfg", io_append);
}
fwrite(file, string);
fclose(file);
idx++;
}
print("Cars saved successfully.");
}
Please help
Re: HELP input line too long -
falco3205 - 29.03.2014
sorry but you write two format??
Ex.
format(string,sizeof(string),"% d |% d |% s |% f |% f |% f |% f ",CarInfo [idx] [c Stato], CarInfo [idx] [cDealership], CarInfo [IDX ] [cOwner], CarInfo [idx] [cX]);
format(string,sizeof(string),"% d |% d |% s |% f |% f |% f |% f ", CarInfo [idx] [cMod8], CarInfo [idx] [cMod9], CarInfo [idx] [cMod10]);
ecc...