trouble with Biz saving for player
#4

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.");
}
io_write always clears the data from the file and then write so dont use it
no need for creating file too caz if file doesnt exit io_append automatically creates it
try my code
Reply


Messages In This Thread
trouble with Biz saving for player - by Acres - 11.07.2014, 08:42
Re: trouble with Biz saving for player - by KayJ - 11.07.2014, 09:09
Re: trouble with Biz saving for player - by Acres - 11.07.2014, 14:07
Re: trouble with Biz saving for player - by BroZeus - 11.07.2014, 14:14
Re: trouble with Biz saving for player - by Konstantinos - 11.07.2014, 14:55

Forum Jump:


Users browsing this thread: 1 Guest(s)