SA-MP Forums Archive
Save Liters - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Save Liters (/showthread.php?tid=282713)



Save Liters - BGMike - 12.09.2011

As you know a few days ago I made ​​a thread where I asked how to do each gas station have a liters fuel.Now here in this thread I asking how do when I stop the server the liters of fuel to retain and when re-start the server the liters are the same as retain ?


Re: Save Liters - Allan Kardec - 12.09.2011

pawn Код:
public OnGameModeExit()
{
     for(new i=0; i<MAX_PLAYERS; i++)
     {
         SaveLiters[i];
     }
     return 1;
}
Use a loop to save the data in an array to store the value and include a recommend SII, as in the example above.


Re: Save Liters - BGMike - 12.09.2011

No no I don't have this forward.
Here's my codes:

Код:
public OnFilterScriptInit()
{
    for(new i=0;i<sizeof(Stations);i++)
    {
        fuelstations[i] = 5000;
    }
    return 1;
}



Re: Save Liters - Allan Kardec - 12.09.2011

pawn Код:
forward Example();
public Example()
{
    for(new i=0;i<sizeof(Stations);i++)
    {
        INI_Open("Liters.txt");
        INI_WriteString("Liters", fuelstations[i]);
        INI_Save();
        INI_Close();
    }
    return 1;
}
pawn Код:
public OnFilterScriptExit()
{
    for(new i=0;i<sizeof(Stations);i++)
    {
        Example();
    }
    return 1;
}
I understood so


Re: Save Liters - BGMike - 12.09.2011

Then in OnFilterScriptInit() what is the function to load Liters.txt ?

Btw errors:

Код:
D:\New Folder\Нова папка\Нова папка\0.3c\filterscripts\speedo.pwn(474) : error 017: undefined symbol "INI_Open"
D:\New Folder\Нова папка\Нова папка\0.3c\filterscripts\speedo.pwn(475) : error 017: undefined symbol "INI_WriteString"
D:\New Folder\Нова папка\Нова папка\0.3c\filterscripts\speedo.pwn(476) : error 017: undefined symbol "INI_Save"
D:\New Folder\Нова папка\Нова папка\0.3c\filterscripts\speedo.pwn(477) : error 017: undefined symbol "INI_Close"



Re: Save Liters - Allan Kardec - 12.09.2011

use the system rescue SII. Download Here
good luck

@edit
look this tutorial
https://sampforum.blast.hk/showthread.php?tid=267808