Savebiz help
#2

pawn Код:
stock SaveBiz()
{
    if(!fexist("biz.cfg")) fcreate("biz.cfg");
    new idx = 1, File:file;
    new string[500];
    new string1[500];
    new string2[500];
    while(idx < MAX_BIZ)
    {
        format(string, sizeof(string), "%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%s|%d|%d|%d|%d|%d|%d|%d", BizInfo[idx][bType], BizInfo[idx][bStatus], BizInfo[idx][bOwner], BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], BizInfo[idx][bMoney], BizInfo[idx][bSold], BizInfo[idx][bLevel], BizInfo[idx][bPrice], BizInfo[idx][bAP], BizInfo[idx][bNpc], BizInfo[idx][bNpcS], BizInfo[idx][b1Am], BizInfo[idx][b2Am], BizInfo[idx][b3Am], BizInfo[idx][b4Am], BizInfo[idx][b5Am]);
        format(string1, sizeof(string1), "%d|%d|%f|%f|%f|%f\r\n", BizInfo[idx][b6Am], BizInfo[idx][bOfficeType], BizInfo[idx][bActionX], BizInfo[idx][bActionY], BizInfo[idx][bActionZ], BizInfo[idx][bActionAngle]);
        format(string2, sizeof(string2), "%s%s\n", string, string1);
        if(idx == 1)
        {
            file = fopen("biz.cfg", io_write);
        }
        else
        {
            file = fopen("biz.cfg", io_append);
        }
        fwrite(file, string2);
        fclose(file);
        idx++;
    }
    print("Businesses saved successfully.");
}
Reply


Messages In This Thread
Savebiz help - by jeffery30162 - 20.07.2014, 16:24
Re: Savebiz help - by Metharon - 20.07.2014, 16:33
Re: Savebiz help - by jeffery30162 - 20.07.2014, 16:38
Re: Savebiz help - by jeffery30162 - 20.07.2014, 17:48
Re: Savebiz help - by Scottas - 20.07.2014, 20:50
Re: Savebiz help - by jeffery30162 - 20.07.2014, 21:40
Re: Savebiz help - by Scottas - 21.07.2014, 03:23

Forum Jump:


Users browsing this thread: 2 Guest(s)