Bizz save problem
#1

When i add a bizz and after i restart my server the bizz is just disappear

pawn Код:
idx = 0;
    while (idx < sizeof(BizzInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%s,%d,%d,%d,%f,%f,%f,%f,%f,%f,%s,%d,%d,%d,%d\n",
        BizzInfo[idx][bName],
        BizzInfo[idx][bLock],
        BizzInfo[idx][bHours],
        BizzInfo[idx][bPrice],
        BizzInfo[idx][bEnterX],
        BizzInfo[idx][bEnterY],
        BizzInfo[idx][bEnterZ],
        BizzInfo[idx][bExitX],
        BizzInfo[idx][bExitY],
        BizzInfo[idx][bExitZ],
        BizzInfo[idx][bOwner],
        BizzInfo[idx][bOwned],
        BizzInfo[idx][bInterior],
        BizzInfo[idx][bType],
        BizzInfo[idx][bMoney]);
        if(idx == 0)
        {
            file2 = fopen("bizz.cfg", io_write);
        }
        else
        {
            file2 = fopen("bizz.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
Reply
#2

Hey N0Fear

Well does it show any errors when you compile the script? or it just the biz disappear after you restart server?
Reply
#3

Quote:
Originally Posted by James_Nick
Посмотреть сообщение
Hey N0Fear

Well does it show any errors when you compile the script? or it just the biz disappear after you restart server?
No errors, the biz just disappear after restart.
Reply
#4

Can you show the original system? or this is it?
Reply
#5

Yes is the original.
Reply
#6

I think he does not have a saving system, If i am right use Y_INI
Reply
#7

Then,where is your biz saving system?
Reply
#8

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
I think he does not have a saving system, If i am right use Y_INI
This one is the save. i use it on public OnPropUpdate()

pawn Код:
idx = 0;
    while (idx < sizeof(BizzInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%s,%d,%d,%d,%f,%f,%f,%f,%f,%f,%s,%d,%d,%d,%d\n",
        BizzInfo[idx][bName],
        BizzInfo[idx][bLock],
        BizzInfo[idx][bHours],
        BizzInfo[idx][bPrice],
        BizzInfo[idx][bEnterX],
        BizzInfo[idx][bEnterY],
        BizzInfo[idx][bEnterZ],
        BizzInfo[idx][bExitX],
        BizzInfo[idx][bExitY],
        BizzInfo[idx][bExitZ],
        BizzInfo[idx][bOwner],
        BizzInfo[idx][bOwned],
        BizzInfo[idx][bInterior],
        BizzInfo[idx][bType],
        BizzInfo[idx][bMoney]);
        if(idx == 0)
        {
            file2 = fopen("bizz.cfg", io_write);
        }
        else
        {
            file2 = fopen("bizz.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
Reply
#9

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
This one is the save. i use it on public OnPropUpdate()

pawn Код:
idx = 0;
    while (idx < sizeof(BizzInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%s,%d,%d,%d,%f,%f,%f,%f,%f,%f,%s,%d,%d,%d,%d\n",
        BizzInfo[idx][bName],
        BizzInfo[idx][bLock],
        BizzInfo[idx][bHours],
        BizzInfo[idx][bPrice],
        BizzInfo[idx][bEnterX],
        BizzInfo[idx][bEnterY],
        BizzInfo[idx][bEnterZ],
        BizzInfo[idx][bExitX],
        BizzInfo[idx][bExitY],
        BizzInfo[idx][bExitZ],
        BizzInfo[idx][bOwner],
        BizzInfo[idx][bOwned],
        BizzInfo[idx][bInterior],
        BizzInfo[idx][bType],
        BizzInfo[idx][bMoney]);
        if(idx == 0)
        {
            file2 = fopen("bizz.cfg", io_write);
        }
        else
        {
            file2 = fopen("bizz.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);

Ok,This what I ment I told you where is the original biz system what I mean the biz system code,this is the saving system can you give the original biz system?


Sorry for not making you understanding what I'm saying but just my english is bad I ain't a english person.
Reply
#10

pawn Код:
enum bInfo
{
    bName[128],
    bLock,
    bHours,
    bPrice,
    Float:bEnterX,
    Float:bEnterY,
    Float:bEnterZ,
    Float:bExitX,
    Float:bExitY,
    Float:bExitZ,
    bOwner[64],
    bOwned,
    bInterior,
    bPickupID,
    bType, // 0: None, 1: Gun Shop, 2: Bar, 3: Restaurant, 4: Store
    bMoney,
};

new BizzInfo[58][bInfo];

}

public LoadBizz()
{
    new arrCoords[23][64];
    new strFromFile2[256];
    new File: file = fopen("bizz.cfg", io_read);
    if (file)
    {
        new idx;
        while (idx < sizeof(BizzInfo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, '|');
            BizzInfo[idx][bName] = strval(arrCoords[0]);
            BizzInfo[idx][bLock] = strval(arrCoords[1]);
            BizzInfo[idx][bHours] = strval(arrCoords[2]);
            BizzInfo[idx][bPrice] = strval(arrCoords[3]);
            BizzInfo[idx][bPrice] = strval(arrCoords[3]);
            BizzInfo[idx][bEnterX] = floatstr(arrCoords[4]);
            BizzInfo[idx][bEnterY] = floatstr(arrCoords[5]);
            BizzInfo[idx][bEnterZ] = floatstr(arrCoords[6]);
            BizzInfo[idx][bExitX] = floatstr(arrCoords[7]);
            BizzInfo[idx][bExitY] = floatstr(arrCoords[8]);
            BizzInfo[idx][bExitZ] = floatstr(arrCoords[9]);
            strmid(BizzInfo[idx][bOwner], arrCoords[10], 0, strlen(arrCoords[1]), 255);
            BizzInfo[idx][bOwned] = strval(arrCoords[11]);
            BizzInfo[idx][bInterior] = strval(arrCoords[12]);
            BizzInfo[idx][bType] = strval(arrCoords[13]);
            BizzInfo[idx][bMoney] = strval(arrCoords[14]);
            idx++;
        }
        fclose(file);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)