16.02.2014, 23:43
I found something to help me but the Id for count the vehicles is the Same = 1
In my vehicules.cfg
1|568|0|159.164733|1191.708618|14.953808|163.54959 1|-1|-1|100.000000|13.259981
1|568|0|-161.715179|1083.066772|19.548107|312.414306|-1|-1|100.000000|14.919998
1|0|0|0.000000|0.000000|0.000000|0.000000|-1|-1|100.000000|14.919998
EDIT : I check up for this part "|-1|-1|100.000000|14.919998" and i solve them don't woory about it
PHP код:
stock SaveVeh()
{
new idx = 1, File:file;
new stringv[256];
while(idx < MAX_VEHICULES)
{
format(stringv, sizeof(stringv),"%d|%d|%d|%f|%f|%f|%f|%d|%d|%f|%f\r\n",
VInfo[idx][vId],
VInfo[idx][vModel],
VInfo[idx][vMoteur],
VInfo[idx][vX],
VInfo[idx][vY],
VInfo[idx][vZ],
VInfo[idx][vA],
VInfo[idx][vCol1],
VInfo[idx][vCol2],
VInfo[idx][vMessence],
VInfo[idx][vEssence]);
if(idx == 1)
{
file = fopen("vehicules.cfg", io_write);
}
else
{
file = fopen("vehicules.cfg", io_append);
}
fwrite(file, stringv);
fclose(file);
idx++;
}
print("Vehicules sauvegarder correctement.");
return 1;
}
1|568|0|159.164733|1191.708618|14.953808|163.54959 1|-1|-1|100.000000|13.259981
1|568|0|-161.715179|1083.066772|19.548107|312.414306|-1|-1|100.000000|14.919998
1|0|0|0.000000|0.000000|0.000000|0.000000|-1|-1|100.000000|14.919998
EDIT : I check up for this part "|-1|-1|100.000000|14.919998" and i solve them don't woory about it