11.07.2014, 14:14
pawn Код:
stock SaveBiz()
{
new idx = 1, File:file;
new string[256];
while(idx < MAX_BIZ)
{
format(string, sizeof(string), "%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d\r\n", BizInfo[idx][bType], BizInfo[idx][bStatus], BizInfo[idx][bOwner], BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], BizInfo[idx][bMoney], BizInfo[idx][bProducts], BizInfo[idx][bSold], BizInfo[idx][bLevel], BizInfo[idx][bPrice], BizInfo[idx][bAP]);
file = fopen("biz.cfg", io_append);
fwrite(file, string);
fclose(file);
idx++;
}
print("Businesses saved at script file biz.cfg successfully.");
}
no need for creating file too caz if file doesnt exit io_append automatically creates it
try my code