Score are gone [HELP] +rep -
adios1 - 02.04.2013
hey guys So I have a server but my problem is when I play for like few minutes and my score is for example its 100. and when I close the server (CMD based) and open it, my scores are gone. how can I save that ?
Re: Score are gone [HELP] +rep -
L.Hudson - 02.04.2013
You can use Y_Ini or dini... and I don't need your REP
Re: Score are gone [HELP] +rep -
Isolated - 02.04.2013
Do you have an account system?
Re: Score are gone [HELP] +rep -
adios1 - 02.04.2013
i have dini but still it doesn't save
AW: Score are gone [HELP] +rep -
[AK]Nazgul - 02.04.2013
be sure to save the userdata also on OnGameModeExit
Here:
Код:
public OnGameModeExit()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
SavePlayer(i); // or whatever your save function is called
}
}
Re: AW: Score are gone [HELP] +rep -
adios1 - 03.04.2013
Quote:
Originally Posted by [AK]Nazgul
be sure to save the userdata also on OnGameModeExit
Here:
Код:
public OnGameModeExit()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
SavePlayer(i); // or whatever your save function is called
}
}
|
I already have this but still not saving
Re: Score are gone [HELP] +rep -
HurtLocker - 03.04.2013
In the same way you created stats for a registered player (money-score-kills-deaths or whatever), create one more and that is "Logged". When Logged=1 means player is logged in. Adding an if (Logged==1) under
public OnPlayerUpdate(playerid) will make this public be triggered only when player is logged in. What is happening to your situation is that OnplayerUpdate takes the stats values as soon as you enter, which of cource are all 0 and set them in .ini file, reseting your stats. I had the same exact problem and that's how i solved it.
AW: Score are gone [HELP] +rep -
[AK]Nazgul - 03.04.2013
I solved the problem by doing the following:
Код:
- On each restart function in your script:
> Save all players
> Set logged for all players to 0
- OnPlayerDisconnect
> Only save a players stats if logged == 1
Re: AW: Score are gone [HELP] +rep -
HurtLocker - 03.04.2013
Quote:
Originally Posted by [AK]Nazgul
I solved the problem by doing the following:
Код:
- On each restart function in your script:
> Save all players
> Set logged for all players to 0
- OnPlayerDisconnect
> Only save a players stats if logged == 1
|
That's what I said smart ass. Stated in a misleading way too.
AW: Re: AW: Score are gone [HELP] +rep -
[AK]Nazgul - 03.04.2013
Quote:
Originally Posted by HurtLocker
That's what I said smart ass. Stated in a misleading way too.
|
I said 'add it in OnPlayerDisconnect', not in OnplayerUpdate