Saving problem.
#1

my Server don't save my stuff.ini anymore.

I use LoadStuff and SaveStuff

pawn Код:
public SaveStuff()
{
    if(TOGGLE_DEBUG_MODE)
    {
        print(" //DEBUG: CALL SaveStuff()");
    }
   
    new coordsstring[256];
    format(coordsstring, sizeof(coordsstring), "$%d,$%d,$%d,%d,$%d, LcnMats: %d, LcnBombs: %d, LcnMoney: $%d, YakMats: %d, YakBombs: %d, YakMoney: $%d, HitMats: %d, HitBombs: %d, HitMoney: $%d, StMats: %d, StBombs: %d, StMoney: $%d, RAMats: %d, RABombs: %d, RAMoney: $%d, NPC Bus price: $%d",
    Jackpot,Tax,TaxValue,Security,V_A_T,
    lMats,lBombs,lMoney,
    yMats,yBombs,yMoney,
    hMats,hBombs,hMoney,
    stMats,stBombs,stMoney,
    raMats,raBombs,raMoney,
    busprice);
    new File: file2 = fopen("stuff.ini", io_write);
    fwrite(file2, coordsstring);
    fclose(file2);
    return 1;
}
public LoadStuff()
{
    if(TOGGLE_DEBUG_MODE)
    {
        print(" //DEBUG: CALL LoadStuff()");
    }

    new arrCoords[21][64];
    new strFromFile2[256];
    new File: file = fopen("stuff.ini", io_read);
    if (file)
    {
        fread(file, strFromFile2);
        split(strFromFile2, arrCoords, ',');
        Jackpot = strval(arrCoords[0]);
        Tax = strval(arrCoords[1]);
        TaxValue = strval(arrCoords[2]);
        Security = strval(arrCoords[3]);
        V_A_T = strval(arrCoords[4]);
        lMats = strval(arrCoords[5]);
        lBombs = strval(arrCoords[6]);
        lMoney = strval(arrCoords[7]);
        yMats = strval(arrCoords[8]);
        yBombs = strval(arrCoords[9]);
        yMoney = strval(arrCoords[10]);
        hMats = strval(arrCoords[11]);
        hBombs = strval(arrCoords[12]);
        hMoney = strval(arrCoords[13]);
        stMats = strval(arrCoords[14]);
        stBombs = strval(arrCoords[15]);
        stMoney = strval(arrCoords[16]);
        raMats = strval(arrCoords[17]);
        raBombs = strval(arrCoords[18]);
        raMoney = strval(arrCoords[19]);
        busprice = strval(arrCoords[20]);
        fclose(file);
        if(Security == 0 || Security == 1)
        {
        }
        else
        {
          GameModeExit();
        }
    }
    else
    {
      GameModeExit();
    }
    return 1;
}
I think there is a problem, with loading the stuff.ini.
Reply
#2

One thing.. "print(" //DEBUG: CALL LoadStuff()");"

Are you sure you can comment half of a function and it will still compile?
Reply
#3

Quote:
Originally Posted by www.trueroleplay.com
One thing.. "print(" //DEBUG: CALL LoadStuff()");"

Are you sure you can comment half of a function and it will still compile?
It won't comment anything, it's under " ".
Reply
#4

Anyone knows the problem.?
Reply
#5

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by www.trueroleplay.com
One thing.. "print(" //DEBUG: CALL LoadStuff()");"

Are you sure you can comment half of a function and it will still compile?
It won't comment anything, it's under " ".
It does.
Reply
#6

Quote:
Originally Posted by Jakku
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by www.trueroleplay.com
One thing.. "print(" //DEBUG: CALL LoadStuff()");"

Are you sure you can comment half of a function and it will still compile?
It won't comment anything, it's under " ".
It does.
Don is correct, nothing will be commented.
Reply
#7

Does anybody know, if it is correct?
Reply
#8

Quote:
Originally Posted by Jakku
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by www.trueroleplay.com
One thing.. "print(" //DEBUG: CALL LoadStuff()");"

Are you sure you can comment half of a function and it will still compile?
It won't comment anything, it's under " ".
It does.
No, it doesn't. I believe you're confused because you see everything green after the // in PAWN-tag in the first post. It's just the PAWN-tag mod for SMF forum.
Reply
#9

Quote:
Originally Posted by #.'
my Server don't save my stuff.ini anymore.

I use LoadStuff and SaveStuff

pawn Код:
public SaveStuff()
{
    if(TOGGLE_DEBUG_MODE)
    {
        print(" //DEBUG: CALL SaveStuff()");
    }
   
    new coordsstring[256];
    format(coordsstring, sizeof(coordsstring), "$%d,$%d,$%d,%d,$%d, LcnMats: %d, LcnBombs: %d, LcnMoney: $%d, YakMats: %d, YakBombs: %d, YakMoney: $%d, HitMats: %d, HitBombs: %d, HitMoney: $%d, StMats: %d, StBombs: %d, StMoney: $%d, RAMats: %d, RABombs: %d, RAMoney: $%d, NPC Bus price: $%d",
    Jackpot,Tax,TaxValue,Security,V_A_T,
    lMats,lBombs,lMoney,
    yMats,yBombs,yMoney,
    hMats,hBombs,hMoney,
    stMats,stBombs,stMoney,
    raMats,raBombs,raMoney,
    busprice);
    new File: file2 = fopen("stuff.ini", io_write);
    fwrite(file2, coordsstring);
    fclose(file2);
    return 1;
}
public LoadStuff()
{
    if(TOGGLE_DEBUG_MODE)
    {
        print(" //DEBUG: CALL LoadStuff()");
    }

    new arrCoords[21][64];
    new strFromFile2[256];
    new File: file = fopen("stuff.ini", io_read);
    if (file)
    {
        fread(file, strFromFile2);
        split(strFromFile2, arrCoords, ',');
        Jackpot = strval(arrCoords[0]);
        Tax = strval(arrCoords[1]);
        TaxValue = strval(arrCoords[2]);
        Security = strval(arrCoords[3]);
        V_A_T = strval(arrCoords[4]);
        lMats = strval(arrCoords[5]);
        lBombs = strval(arrCoords[6]);
        lMoney = strval(arrCoords[7]);
        yMats = strval(arrCoords[8]);
        yBombs = strval(arrCoords[9]);
        yMoney = strval(arrCoords[10]);
        hMats = strval(arrCoords[11]);
        hBombs = strval(arrCoords[12]);
        hMoney = strval(arrCoords[13]);
        stMats = strval(arrCoords[14]);
        stBombs = strval(arrCoords[15]);
        stMoney = strval(arrCoords[16]);
        raMats = strval(arrCoords[17]);
        raBombs = strval(arrCoords[18]);
        raMoney = strval(arrCoords[19]);
        busprice = strval(arrCoords[20]);
        fclose(file);
        if(Security == 0 || Security == 1)
        {
        }
        else
        {
          GameModeExit();
        }
    }
    else
    {
      GameModeExit();
    }
    return 1;
}
I think there is a problem, with loading the stuff.ini.
In my opinion ...

pawn Код:
public SaveStuff()
{
    if(TOGGLE_DEBUG_MODE)
    {
        print("DEBUG: CALL SaveStuff()");
    }
   
    new coordsstring[256];
    format(coordsstring, sizeof(coordsstring), "$%d,$%d,$%d,%d,$%d, LcnMats: %d, LcnBombs: %d, LcnMoney: $%d, YakMats: %d, YakBombs: %d, YakMoney: $%d, HitMats: %d, HitBombs: %d, HitMoney: $%d, StMats: %d, StBombs: %d, StMoney: $%d, RAMats: %d, RABombs: %d, RAMoney: $%d, NPC Bus price: $%d",
    Jackpot,Tax,TaxValue,Security,V_A_T,
    lMats,lBombs,lMoney,
    yMats,yBombs,yMoney,
    hMats,hBombs,hMoney,
    stMats,stBombs,stMoney,
    raMats,raBombs,raMoney,
    busprice);
    new File: file2 = fopen("stuff.ini", io_write);
    fwrite(file2, coordsstring);
    fclose(file2);
    return 1;
}
public LoadStuff()
{
    if(TOGGLE_DEBUG_MODE)
    {
        print("DEBUG: CALL LoadStuff()");
    }

    new arrCoords[21][64];
    new strFromFile2[256];
    new File: file = fopen("stuff.ini", io_read);
    if (file)
    {
        fread(file, strFromFile2);
        split(strFromFile2, arrCoords, ',');
        Jackpot = strval(arrCoords[0]);
        Tax = strval(arrCoords[1]);
        TaxValue = strval(arrCoords[2]);
        Security = strval(arrCoords[3]);
        V_A_T = strval(arrCoords[4]);
        lMats = strval(arrCoords[5]);
        lBombs = strval(arrCoords[6]);
        lMoney = strval(arrCoords[7]);
        yMats = strval(arrCoords[8]);
        yBombs = strval(arrCoords[9]);
        yMoney = strval(arrCoords[10]);
        hMats = strval(arrCoords[11]);
        hBombs = strval(arrCoords[12]);
        hMoney = strval(arrCoords[13]);
        stMats = strval(arrCoords[14]);
        stBombs = strval(arrCoords[15]);
        stMoney = strval(arrCoords[16]);
        raMats = strval(arrCoords[17]);
        raBombs = strval(arrCoords[18]);
        raMoney = strval(arrCoords[19]);
        busprice = strval(arrCoords[20]);
        fclose(file);
        if(Security == 0 || Security == 1)
        {
        }
        else
        {
          GameModeExit();
        }
    }
    else
    {
      GameModeExit();
    }
    return 1;
}
Reply
#10

Are the debug lines printed?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)