SA-MP Forums Archive
Stats wont save!!! - 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: Stats wont save!!! (/showthread.php?tid=544306)



Stats wont save!!! - 9noober - 01.11.2014

After i restart my server my stats will lost.
How to fix it
anybody know
Help me pls!!!


Re: Stats wont save!!! - HY - 01.11.2014

Can you show us your OnPlayerDisconnect code?


Re: Stats wont save!!! - Ryz - 01.11.2014

pawn Код:
public OnGameModeExit()
{
    foreach(Player, i)
    {
        //YOUR SAVING SYSTEM HERE
    }
    return 1;
}



Re: Stats wont save!!! - 9noober - 01.11.2014

public OnPlayerDisconnect( playerid, reason )
{
new INI:File = INI_Open( user_ini_file( playerid ) );
INI_WriteInt( File, "c4", c4[playerid] );
INI_Close( File );
return ( 1 );
}


Re: Stats wont save!!! - HY - 01.11.2014

pawn Код:
public OnPlayerDisconnect( playerid, reason )
{
    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_WriteInt( File, "c4", c4[playerid] );
    INI_Close( File );
    return ( 1 );
}
- You have only C4 file, wich is saving, but if you want your kills/cash/score/Admin/Vip to save, you need to write them too.


Re: Stats wont save!!! - 9noober - 01.11.2014

i want to save c4 only
when i quit and rejoin the server my C4 will save and load after i restart the server my C4 = 0


Re: Stats wont save!!! - Beckett - 01.11.2014

Quote:
Originally Posted by Ryz
Посмотреть сообщение
pawn Код:
public OnGameModeExit()
{
    foreach(Player, i)
    {
        //YOUR SAVING SYSTEM HERE
    }
    return 1;
}
No, this code is completely wrong.

Quote:
Originally Posted by 9noober
Посмотреть сообщение
i want to save c4 only
when i quit and rejoin the server my C4 will save and load after i restart the server my C4 = 0
Make an ingame restart command which will kick all players then in 1 second it'll restart the server.


Re: Stats wont save!!! - Ryz - 01.11.2014

Quote:
Originally Posted by 9noober
Посмотреть сообщение
After i restart my server my stats will lost.
How to fix it
anybody know
Help me pls!!!
Quote:
Originally Posted by 9noober
Посмотреть сообщение
i want to save c4 only
when i quit and rejoin the server my C4 will save and load after i restart the server my C4 = 0
why you say's 'when i quit and rejoin'? see you first post you sayed 'After i restart my server'


Re: Stats wont save!!! - 9noober - 01.11.2014

If i quit and rejoin my stats will load
but if i restart my server my stats will lost